com.atlassian.httpclient.api
Interface Request.Builder

All Superinterfaces:
Buildable<Request>, Common<Request.Builder>
Enclosing interface:
Request

public static interface Request.Builder
extends Common<Request.Builder>, Buildable<Request>


Method Summary
 ResponsePromise delete()
          Executes this request through the HttpClient service as a DELETE operation.
 ResponsePromise execute(Request.Method method)
          Executes this request through the HttpClient service using the given HTTP method.
 ResponsePromise get()
          Executes this request through the HttpClient service as a GET operation.
 ResponsePromise head()
          Executes this request through the HttpClient service as a HEAD operation.
 ResponsePromise options()
          Executes this request through the HttpClient service as a OPTIONS operation.
 ResponsePromise post()
          Executes this request through the HttpClient service as a POST operation.
 ResponsePromise put()
          Executes this request through the HttpClient service as a PUT operation.
 Request.Builder setAccept(String accept)
          Sets the Accept header for the request.
 Request.Builder setAttribute(String name, String value)
          Sets an attribute on the request.
 Request.Builder setAttributes(Map<String,String> properties)
          Sets attributes on the request.
 Request.Builder setCacheDisabled()
          Bypasses the cache for this request
 Request.Builder setContentLength(long contentLength)
          Set the content length for the message.
 Request.Builder setEntity(EntityBuilder entityBuilder)
          Sets the entity and any associated headers from an entity builder.
 Request.Builder setHeader(String name, String value)
          Sets an HTTP header on this object.
 Request.Builder setUri(URI uri)
          Sets this request's URI.
 ResponsePromise trace()
          Executes this request through the HttpClient service as a TRACE operation.
 
Methods inherited from interface com.atlassian.httpclient.api.Common
setContentCharset, setContentType, setEntity, setEntityStream, setEntityStream, setHeaders
 
Methods inherited from interface com.atlassian.httpclient.api.Buildable
build
 

Method Detail

setUri

Request.Builder setUri(URI uri)
Sets this request's URI. Must not be null by the time the request is executed.

Parameters:
uri - The URI
Returns:
This object, for builder-style chaining

setAccept

Request.Builder setAccept(String accept)
Sets the Accept header for the request.

Parameters:
accept - An accept header expression containing media types, ranges, and/or quality factors
Returns:
This object, for builder-style chaining

setCacheDisabled

Request.Builder setCacheDisabled()
Bypasses the cache for this request

Returns:
This object, for builder-style chaining

setAttribute

Request.Builder setAttribute(String name,
                             String value)
Sets an attribute on the request. Attributes are request metadata that are forwarded to the analytics plugin when enabled.

Parameters:
name - The attribute name
value - The attribute value
Returns:
This object, for builder-style chaining

setAttributes

Request.Builder setAttributes(Map<String,String> properties)
Sets attributes on the request. Attributes are request metadata that are forwarded to the analytics plugin when enabled.

Parameters:
properties - A map of attributes
Returns:
This object, for builder-style chaining

setContentLength

Request.Builder setContentLength(long contentLength)
Set the content length for the message. Use this to explicitly override the content length determined from the entity in the message (e.g. if you want to stream the entity without chunking).

Parameters:
contentLength - The content length. This must be valid (greater than 0).
Returns:
This object, for builder-style chaining

setEntity

Request.Builder setEntity(EntityBuilder entityBuilder)
Sets the entity and any associated headers from an entity builder.

Parameters:
entityBuilder - An entity builder
Returns:
This object, for builder-style chaining

setHeader

Request.Builder setHeader(String name,
                          String value)
Description copied from interface: Common
Sets an HTTP header on this object. If the header's name is "Content-Type", the value will be parsed into this object's content type and content charset properties, as appropriate.

Specified by:
setHeader in interface Common<Request.Builder>
Parameters:
name - The name of the header to be set
value - The value of the header to be set
Returns:
This object, for builder-style chaining

get

ResponsePromise get()
Executes this request through the HttpClient service as a GET operation. The request SHOULD NOT contain an entity for the GET operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

post

ResponsePromise post()
Executes this request through the HttpClient service as a POST operation. The request SHOULD contain an entity for the POST operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

put

ResponsePromise put()
Executes this request through the HttpClient service as a PUT operation. The request SHOULD contain an entity for the PUT operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

delete

ResponsePromise delete()
Executes this request through the HttpClient service as a DELETE operation. The request SHOULD NOT contain an entity for the DELETE operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

options

ResponsePromise options()
Executes this request through the HttpClient service as a OPTIONS operation. The request MAY contain an entity for the OPTIONS operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

head

ResponsePromise head()
Executes this request through the HttpClient service as a HEAD operation. The request SHOULD NOT contain an entity for the HEAD operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

trace

ResponsePromise trace()
Executes this request through the HttpClient service as a TRACE operation. The request SHOULD contain an entity for the TRACE operation.

Returns:
A promise object that can be used to receive the response and handle exceptions

execute

ResponsePromise execute(Request.Method method)
Executes this request through the HttpClient service using the given HTTP method.

Parameters:
method - the HTTP method to use.
Returns:
A promise object that can be used to receive the response and handle exceptions


Copyright © 2012–2015 Atlassian. All rights reserved.