|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface Response.Builder
| Method Summary | |
|---|---|
Response.Builder |
setContentCharset(String contentCharset)
Sets the charset for this object's entity, if any. |
Response.Builder |
setContentType(String contentType)
Sets the IANA media type, for the current entity, if any. |
Response.Builder |
setEntity(String entity)
Sets this object's entity stream from a string. |
Response.Builder |
setEntityStream(InputStream entityStream)
Sets this object's entity as an input stream. |
Response.Builder |
setEntityStream(InputStream entityStream,
String encoding)
Sets this object's entity as an input stream, encoded with the specified charset. |
Response.Builder |
setHeader(String name,
String value)
Sets an HTTP header on this object. |
Response.Builder |
setHeaders(Map<String,String> headers)
Copies the specified map of HTTP headers into this object. |
Response.Builder |
setStatusCode(int statusCode)
Sets the status code of the response. |
Response.Builder |
setStatusText(String statusText)
Sets the status text of the response. |
| Methods inherited from interface com.atlassian.httpclient.api.Buildable |
|---|
build |
| Method Detail |
|---|
Response.Builder setContentType(String contentType)
CommoncontentType 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 Common<Response.Builder>contentType - An IANA media type with optional charset information
Response.Builder setContentCharset(String contentCharset)
Common
setContentCharset in interface Common<Response.Builder>contentCharset - The entity's charset value, or null
Response.Builder setHeaders(Map<String,String> headers)
Common
setHeaders in interface Common<Response.Builder>headers - A map of HTTP headers
Response.Builder setHeader(String name,
String value)
Common
setHeader in interface Common<Response.Builder>name - The name of the header to be setvalue - The value of the header to be set
Response.Builder setEntity(String entity)
Common
setEntity in interface Common<Response.Builder>entity - An entity string
Response.Builder setEntityStream(InputStream entityStream,
String encoding)
CommonhasReadEntity() 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 Common<Response.Builder>entityStream - An entity input stream ready to be readencoding - The charset in which the entity stream is encoded
Response.Builder setEntityStream(InputStream entityStream)
CommonhasReadEntity() 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 Common<Response.Builder>entityStream - An entity input stream ready to be read
Response.Builder setStatusText(String statusText)
statusText - The status text
Response.Builder setStatusCode(int statusCode)
statusCode - The status code
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||