|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Request
An interface for building and executing HTTP requests.
| Nested Class Summary | |
|---|---|
static class |
Request.Method
|
| Method Summary | |
|---|---|
ResponsePromise |
delete()
Executes this request through the HttpClient service as a DELETE operation. |
ResponsePromise |
get()
Executes this request through the HttpClient service as a GET operation. |
java.lang.String |
getAccept()
Returns this request's Accept header, if set. |
java.lang.String |
getAttribute(java.lang.String name)
Gets an attribute from the request. |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Gets all attributes for this request. |
Request.Method |
getMethod()
|
java.net.URI |
getUri()
Returns this request's URI, if set. |
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 |
setAccept(java.lang.String accept)
Sets the Accept header for the request. |
Request |
setAttribute(java.lang.String name,
java.lang.String value)
Sets an attribute on the request. |
Request |
setAttributes(java.util.Map<java.lang.String,java.lang.String> properties)
Sets attributes on the request. |
Request |
setCacheDisabled()
Bypasses the cache for this request |
Request |
setContentCharset(java.lang.String contentCharset)
Sets the charset for this object's entity, if any. |
Request |
setContentType(java.lang.String contentType)
Sets the IANA media type, for the current entity, if any. |
Request |
setEntity(EntityBuilder entityBuilder)
Sets the entity and any associated headers from an entity builder. |
Request |
setEntity(java.lang.String entity)
Sets this object's entity stream from a string. |
Request |
setEntityStream(java.io.InputStream entityStream)
Sets this object's entity as an input stream. |
Request |
setEntityStream(java.io.InputStream entityStream,
java.lang.String encoding)
Sets this object's entity as an input stream, encoded with the specified charset. |
Request |
setHeader(java.lang.String name,
java.lang.String value)
Sets an HTTP header on this object. |
Request |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Copies the specified map of HTTP headers into this object. |
Request |
setUri(java.net.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.Message |
|---|
getContentCharset, getContentType, getEntity, getEntityStream, getHeader, getHeaders, hasEntity, hasReadEntity, isFrozen |
| Method Detail |
|---|
java.net.URI getUri()
Request setUri(java.net.URI uri)
uri - The URI
java.lang.String getAccept()
Request setAccept(java.lang.String accept)
accept - An accept header expression containing media types, ranges, and/or quality factors
Request setCacheDisabled()
Request setAttribute(java.lang.String name,
java.lang.String value)
name - The attribute namevalue - The attribute value
Request setAttributes(java.util.Map<java.lang.String,java.lang.String> properties)
properties - A map of attributes
java.lang.String getAttribute(java.lang.String name)
name - The attribute name
java.util.Map<java.lang.String,java.lang.String> getAttributes()
Request setEntity(EntityBuilder entityBuilder)
entityBuilder - An entity builder
ResponsePromise get()
HttpClient service as a GET operation.
The request SHOULD NOT contain an entity for the GET operation.
ResponsePromise post()
HttpClient service as a POST operation.
The request SHOULD contain an entity for the POST operation.
ResponsePromise put()
HttpClient service as a PUT operation.
The request SHOULD contain an entity for the PUT operation.
ResponsePromise delete()
HttpClient service as a DELETE operation.
The request SHOULD NOT contain an entity for the DELETE operation.
ResponsePromise options()
HttpClient service as a OPTIONS operation.
The request MAY contain an entity for the OPTIONS operation.
ResponsePromise head()
HttpClient service as a HEAD operation.
The request SHOULD NOT contain an entity for the HEAD operation.
ResponsePromise trace()
HttpClient service as a TRACE operation.
The request SHOULD contain an entity for the TRACE operation.
Request.Method getMethod()
Request setContentType(java.lang.String contentType)
MessagecontentType argument
also contains charset information, this method will have the side effect of parsing the charset
out and storing the component parts independently. The method getContentCharset() can
be used to retrieve extracted content charset, if present, and getHeader("Content-Type")
can be used to retrieve the entire Content-Type header, complete with charset information, if set.
The content type property is required when an entity is present.
setContentType in interface MessagecontentType - An IANA media type with optional charset information
Request setContentCharset(java.lang.String contentCharset)
Message
setContentCharset in interface MessagecontentCharset - The entity's charset value, or null
Request setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Message
setHeaders in interface Messageheaders - A map of HTTP headers
Request setHeader(java.lang.String name,
java.lang.String value)
Message
setHeader in interface Messagename - The name of the header to be setvalue - The value of the header to be set
Request setEntity(java.lang.String entity)
Message
setEntity in interface Messageentity - An entity string
Request setEntityStream(java.io.InputStream entityStream,
java.lang.String encoding)
MessagehasReadEntity() state to false. This
method should only be called for entity streams targetting textual media types -- that is, it's
nonsensical to set the charset of an entity stream for binary media types (e.g. image/*, etc).
setEntityStream in interface MessageentityStream - An entity input stream ready to be readencoding - The charset in which the entity stream is encoded
Request setEntityStream(java.io.InputStream entityStream)
MessagehasReadEntity() state to false. It is recommended to also set this
object's content charset property when setting an entity stream for a textual media type (or
using the overloaded form that takes both the entity stream and charset in the same call).
Clients of this object should assume the HTTP standard of ISO-8859-1 (latin-1)
for the content charset property if a textual media type is set but no explcit charset was
provided for this message. A charset should NOT be provided for entity streams targetting
binary media types.
setEntityStream in interface MessageentityStream - An entity input stream ready to be read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||