HTTP request execute interceptor for Google API's that wraps HTTP requests -- other than GET or POST -- inside of a POST request and uses {@code "X-HTTP-Method-Override"} header to specify theactual HTTP method.
Use this for an HTTP transport that doesn't support PATCH like {@code NetHttpTransport} or{@code UrlFetchTransport}. By default, only the methods not supported by the transport will be overridden. When running behind a firewall that does not support certain verbs like PATCH, use the {@link MethodOverride#MethodOverride(EnumSet)} constructor instead to specify additionalmethods to override. GET and POST are never overridden.
Sample usage, taking advantage that this class implements {@link HttpRequestInitializer}:
public static HttpRequestFactory createRequestFactory(HttpTransport transport) { return transport.createRequestFactory(new MethodOverride()); }
If you have a custom request initializer, take a look at the sample usage for {@link HttpExecuteInterceptor}, which this class also implements.
@since 1.4
@author Yaniv Inbar