HttpMethodName httpMethod = HttpMethodName.valueOf(req.getMethod().toString());
/** * Sets HTTP method to the {@link Request} object. If the given method is * none of GET, POST, PUT, DELETE, and HEAD, then it will be tunneled via * X-HTTP-Method-Override. Note that not all servers support this header. * * @param request request to be set * @param httpMethod given http method * @param hasContent indicate whether the request has content body */ void setHttpMethod(Request<?> request, String httpMethod, boolean hasContent) { try { request.setHttpMethod(HttpMethodName.valueOf(httpMethod)); } catch (final IllegalArgumentException iae) { // if an HTTP method is unsupported, then 'tunnel' it through // another method by setting the intended method in the // X-HTTP-Method-Override header. request.addHeader("X-HTTP-Method-Override", httpMethod); // depending on whether the request has content or not, choose an // appropriate method. request.setHttpMethod(hasContent ? HttpMethodName.POST : HttpMethodName.GET); } }
final HttpMethodName httpMethod = HttpMethodName.valueOf(generatePresignedUrlRequest.getMethod() .toString());
@Override public HttpMethodName getHttpMethod() { return HttpMethodName.valueOf(clientRequestContext.getMethod()); }
r.setHttpMethod(HttpMethodName.valueOf(httpMethod));
r.setHttpMethod(HttpMethodName.valueOf(httpMethod));
/** * Sets HTTP method to the {@link Request} object. If the given method is * none of GET, POST, PUT, DELETE, and HEAD, then it will be tunneled via * X-HTTP-Method-Override. Note that not all servers support this header. * * @param request request to be set * @param httpMethod given http method * @param hasContent indicate whether the request has content body */ void setHttpMethod(Request<?> request, String httpMethod, boolean hasContent) { try { request.setHttpMethod(HttpMethodName.valueOf(httpMethod)); } catch (final IllegalArgumentException iae) { // if an HTTP method is unsupported, then 'tunnel' it through // another method by setting the intended method in the // X-HTTP-Method-Override header. request.addHeader("X-HTTP-Method-Override", httpMethod); // depending on whether the request has content or not, choose an // appropriate method. request.setHttpMethod(hasContent ? HttpMethodName.POST : HttpMethodName.GET); } }
dr.setHttpMethod(HttpMethodName.valueOf(req.method()));
HttpMethodName httpMethod = HttpMethodName.valueOf(req.getMethod().toString());
final HttpMethodName httpMethod = HttpMethodName.valueOf(generatePresignedUrlRequest.getMethod() .toString());