Code example for HttpRequestBase

Methods: addHeader

   * @throws IOException 
  public static ReadableResponse signedRequest(String verb, String request, CommonsHttpOAuthConsumer consumer, String contentType, String entity) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, ClientProtocolException, IOException{
    HttpClient client = new DefaultHttpClient();
    HttpRequestBase reqObject = getRequestBaseByVerbEntity(verb, request, entity);
    reqObject.addHeader("Content-Type", contentType);
    HttpResponse response = client.execute(reqObject);
    return new HttpResponseWrapper(response);
   * Sends a signed HTTP request using the Signpost library 
   * @param verb HTTP verb 
   * @param request request URI 
   * @param consumer the consumer used to sign the request 
   * @param contentType the content-type of the request 
   * @param bodyParams the body parameters of the request 
   * @return a ReadableResponse to the request 
   * @throws OAuthMessageSignerException 
Connect your IDE to all the code out there  Get Codota for Java