org.jenkinsci.plugins.relution.net
Class Request

java.lang.Object
  extended by org.jenkinsci.plugins.relution.net.Request

public class Request
extends Object


Nested Class Summary
static interface Request.Method
          Supported request methods.
 
Constructor Summary
Request(int method, String url)
          Create an new Request Object
 
Method Summary
 void addHeader(String name, String value)
          Add a key/value pair to the Requestheader.
 void addHeader(String name, String format, Object... args)
          Add a key/value pair in an specific format to the Requestheader.
 org.apache.http.client.methods.HttpRequestBase createHttpRequest()
          creation of a new Request (HttpGet, HttpPost, HttpPut, HttpDelete) with a (possibly) number of header values.
 org.apache.http.HttpEntity entity()
           
 RequestQueryFields queryFields()
           
 void setEntity(org.apache.http.HttpEntity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request(int method,
               String url)
Create an new Request Object

Parameters:
method - 0: GET, 1: POST, 2: PUT, 3: DELETE
url - specific url to which the request response
Method Detail

addHeader

public void addHeader(String name,
                      String value)
Add a key/value pair to the Requestheader.

Parameters:
name - key of the Headerfield.
value - value of the Headerfield.

addHeader

public void addHeader(String name,
                      String format,
                      Object... args)
Add a key/value pair in an specific format to the Requestheader.

Parameters:
name - key of the Headerfield.
format - arguments will be concatenated @see String.format(String, Object...)
args - values concatenated to a new value which will be added as a Headerfield.

queryFields

public RequestQueryFields queryFields()
Returns:
all querys appended to an specific URL.

entity

public org.apache.http.HttpEntity entity()
Returns:
Returns the HttpEntity.

setEntity

public void setEntity(org.apache.http.HttpEntity entity)
Parameters:
entity - HttpEntity to be set.

createHttpRequest

public org.apache.http.client.methods.HttpRequestBase createHttpRequest()
                                                                 throws URISyntaxException
creation of a new Request (HttpGet, HttpPost, HttpPut, HttpDelete) with a (possibly) number of header values.

Returns:
new Request (HttpGet, HttpPost, HttpPut, HttpDelete).
Throws:
URISyntaxException


Copyright © 2004-2013. All Rights Reserved.