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 Details

    • 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

      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

      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

      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

      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

      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

      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