protected HttpUriRequest createHttpRequest ( HttpMethod httpMethod , URI uri ) { switch ( httpMethod ) { case GET : return new HttpGet ( uri ) ; case DELETE : return new HttpDelete ( uri ) ; case HEAD : return new HttpHead ( uri ) ; case OPTIONS : return new HttpOptions ( uri ) ; case POST : return new HttpPost ( uri ) ; case PUT : return new HttpPut ( uri ) ; case TRACE : return new HttpTrace ( uri ) ; default : throw new IllegalArgumentException ( "Invalid HTTP method: " + httpMethod ) ; } }
Create a HttpComponents HttpUriRequest object for the given HTTP method and URI specification .