EntityEnclosingMethod enclosingMethod = ("POST".equals(methodType))
? new PostMethod(requestUri)
: new PutMethod(requestUri);
if (request.getPostBodyLength() > 0) {
enclosingMethod.setRequestEntity(new InputStreamRequestEntity(request.getPostBody()));
enclosingMethod.setRequestHeader("Content-Length",
String.valueOf(request.getPostBodyLength()));
}
httpMethod = enclosingMethod;
} else if ("DELETE".equals(methodType)) {