Interface Request.Builder
- All Superinterfaces:
Buildable<Request>, Common<Request.Builder>
- Enclosing interface:
Request
-
Method Summary
Modifier and TypeMethodDescriptiondelete()Executes this request through theHttpClientservice as aDELETEoperation.execute(Request.Method method) Executes this request through theHttpClientservice using the given HTTP method.get()Executes this request through theHttpClientservice as aGEToperation.head()Executes this request through theHttpClientservice as aHEADoperation.options()Executes this request through theHttpClientservice as aOPTIONSoperation.post()Executes this request through theHttpClientservice as aPOSToperation.put()Executes this request through theHttpClientservice as aPUToperation.Sets the Accept header for the request.setAttribute(String name, String value) Sets an attribute on the request.setAttributes(Map<String, String> properties) Sets attributes on the request.Bypasses the cache for this requestsetContentLength(long contentLength) Set the content length for the message.setEntity(EntityBuilder entityBuilder) Sets the entity and any associated headers from an entity builder.Sets an HTTP header on this object.Sets this request's URI.trace()Executes this request through theHttpClientservice as aTRACEoperation.Methods inherited from interface Common
setContentCharset, setContentType, setEntity, setEntityStream, setEntityStream, setHeaders
-
Method Details
-
setUri
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
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
Sets an attribute on the request. Attributes are request metadata that are forwarded to the analytics plugin when enabled.- Parameters:
name- The attribute namevalue- The attribute value- Returns:
- This object, for builder-style chaining
-
setAttributes
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
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
Sets the entity and any associated headers from an entity builder.- Parameters:
entityBuilder- An entity builder- Returns:
- This object, for builder-style chaining
-
setHeader
Description copied from interface:CommonSets 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:
setHeaderin interfaceCommon<Request.Builder>- Parameters:
name- The name of the header to be setvalue- The value of the header to be set- Returns:
- This object, for builder-style chaining
-
get
ResponsePromise get()Executes this request through theHttpClientservice as aGEToperation. The request SHOULD NOT contain an entity for theGEToperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
post
ResponsePromise post()Executes this request through theHttpClientservice as aPOSToperation. The request SHOULD contain an entity for thePOSToperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
put
ResponsePromise put()Executes this request through theHttpClientservice as aPUToperation. The request SHOULD contain an entity for thePUToperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
delete
ResponsePromise delete()Executes this request through theHttpClientservice as aDELETEoperation. The request SHOULD NOT contain an entity for theDELETEoperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
options
ResponsePromise options()Executes this request through theHttpClientservice as aOPTIONSoperation. The request MAY contain an entity for theOPTIONSoperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
head
ResponsePromise head()Executes this request through theHttpClientservice as aHEADoperation. The request SHOULD NOT contain an entity for theHEADoperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
trace
ResponsePromise trace()Executes this request through theHttpClientservice as aTRACEoperation. The request SHOULD contain an entity for theTRACEoperation.- Returns:
- A promise object that can be used to receive the response and handle exceptions
-
execute
Executes this request through theHttpClientservice 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
-