request.setInterceptor(this);
}
public void intercept(HttpRequest request) {
if (overrideThisMethod(request)) {
HttpMethod method = request.getMethod();
request.setMethod(HttpMethod.POST);
request.getHeaders().set("X-HTTP-Method-Override", method.name());
// Google servers will fail to process a POST unless the Content-Length header is specified
if (request.getContent() == null) {
request.setContent(new EmptyContent());
}
}