Added support for HEAD and PATCH requests.