Class HttpRequest

java.lang.Object
org.restlet.Message
org.restlet.Request
org.restlet.engine.adapter.HttpRequest

public class HttpRequest extends Request
Request wrapper for server HTTP calls.
Author:
Jerome Louvel
  • Constructor Details

    • HttpRequest

      public HttpRequest(Context context, ServerCall httpCall)
      Constructor.
      Parameters:
      context - The context of the HTTP server connector that issued the call.
      httpCall - The low-level HTTP server call.
  • Method Details

    • abort

      public boolean abort()
      Description copied from class: Request
      Ask the connector to attempt to abort the related network connection, for example immediately closing the socket.
      Overrides:
      abort in class Request
      Returns:
      True if the request was aborted.
    • flushBuffers

      public void flushBuffers() throws IOException
      Description copied from class: Message
      Asks the underlying connector to immediately flush the network buffers.
      Overrides:
      flushBuffers in class Message
      Throws:
      IOException
    • getAccessControlRequestHeaders

      public Set<String> getAccessControlRequestHeaders()
      Description copied from class: Request
      Returns the modifiable set of headers the client is willing to send in future request to this resource. Used when issuing a preflight CORS request to let the origin server knows what headers will be sent later.
      Note that when used with HTTP connectors, this property maps to the "Access-Control-Allow-Headers" header.
      Overrides:
      getAccessControlRequestHeaders in class Request
      Returns:
      The headers the client is willing to send in future request to this resource. Useful for CORS support.
    • getAccessControlRequestMethod

      public Method getAccessControlRequestMethod()
      Description copied from class: Request
      Returns the method the client is willing to use in future request to this resource. Used when issuing a preflight CORS request to let the origin server knows what method will be sent later.
      Note that when used with HTTP connectors, this property maps to the "Access-Control-Request-Method" header.
      Overrides:
      getAccessControlRequestMethod in class Request
      Returns:
      The method the client is willing to send in future request to this resource. Useful for CORS support.
    • getCacheDirectives

      public List<CacheDirective> getCacheDirectives()
      Description copied from class: Message
      Returns the cache directives.

      Note that when used with HTTP connectors, this property maps to the "Cache-Control" header.
      Overrides:
      getCacheDirectives in class Message
      Returns:
      The cache directives.
    • getChallengeResponse

      public ChallengeResponse getChallengeResponse()
      Description copied from class: Request
      Returns the authentication response sent by a client to an origin server. Note that when used with HTTP connectors, this property maps to the "Authorization" header.
      Overrides:
      getChallengeResponse in class Request
      Returns:
      The authentication response sent by a client to an origin server.
    • getClientInfo

      public ClientInfo getClientInfo()
      Returns the client-specific information.
      Overrides:
      getClientInfo in class Request
      Returns:
      The client-specific information.
    • getConditions

      public Conditions getConditions()
      Returns the condition data applying to this call.
      Overrides:
      getConditions in class Request
      Returns:
      The condition data applying to this call.
    • getCookies

      public Series<Cookie> getCookies()
      Returns the cookies provided by the client.
      Overrides:
      getCookies in class Request
      Returns:
      The cookies provided by the client.
    • getEntity

      public Representation getEntity()
      Returns the representation provided by the client.
      Overrides:
      getEntity in class Message
      Returns:
      The representation provided by the client.
    • getHttpCall

      public ServerCall getHttpCall()
      Returns the low-level HTTP call.
      Returns:
      The low-level HTTP call.
    • getProxyChallengeResponse

      public ChallengeResponse getProxyChallengeResponse()
      Description copied from class: Request
      Returns the authentication response sent by a client to a proxy. Note that when used with HTTP connectors, this property maps to the "Proxy-Authorization" header.
      Overrides:
      getProxyChallengeResponse in class Request
      Returns:
      The authentication response sent by a client to a proxy.
    • getRanges

      public List<Range> getRanges()
      Description copied from class: Request
      Returns the ranges to return from the target resource's representation. Note that when used with HTTP connectors, this property maps to the "Range" header.
      Overrides:
      getRanges in class Request
      Returns:
      The ranges to return.
    • getRecipientsInfo

      public List<RecipientInfo> getRecipientsInfo()
      Description copied from class: Message
      Returns the intermediary recipient information.

      Note that when used with HTTP connectors, this property maps to the "Via" headers.
      Overrides:
      getRecipientsInfo in class Message
      Returns:
      The intermediary recipient information.
    • getReferrerRef

      public Reference getReferrerRef()
      Returns the referrer reference if available.
      Overrides:
      getReferrerRef in class Request
      Returns:
      The referrer reference.
    • getWarnings

      public List<Warning> getWarnings()
      Description copied from class: Message
      Returns the additional warnings information.

      Note that when used with HTTP connectors, this property maps to the "Warning" headers.
      Overrides:
      getWarnings in class Message
      Returns:
      The additional warnings information.
    • setAccessControlRequestHeaders

      public void setAccessControlRequestHeaders(Set<String> accessControlRequestHeaders)
      Description copied from class: Request
      Sets the set of headers the client is willing to use in future request to this resource. Used when issuing a preflight CORS request to let the origin server knows what headers will be sent later.
      Note that when used with HTTP connectors, this property maps to the "Access-Control-Request-Method" header.
      Overrides:
      setAccessControlRequestHeaders in class Request
      Parameters:
      accessControlRequestHeaders - The set of headers the client is willing to send in future request to this resource. Useful for CORS support.
    • setAccessControlRequestMethod

      public void setAccessControlRequestMethod(Method accessControlRequestMethod)
      Description copied from class: Request
      Sets the method the client is willing to use in future request to this resource. Used when issuing a preflight CORS request to let the origin server knows what method will be sent later.
      Note that when used with HTTP connectors, this property maps to the "Access-Control-Request-Method" header.
      Overrides:
      setAccessControlRequestMethod in class Request
      Parameters:
      accessControlRequestMethod - The method the client is willing to send in future request to this resource. Useful for CORS support.
    • setChallengeResponse

      public void setChallengeResponse(ChallengeResponse response)
      Description copied from class: Request
      Sets the authentication response sent by a client to an origin server. Note that when used with HTTP connectors, this property maps to the "Authorization" header.
      Overrides:
      setChallengeResponse in class Request
      Parameters:
      response - The authentication response sent by a client to an origin server.
    • setEntity

      public void setEntity(Representation entity)
      Description copied from class: Message
      Sets the entity representation.
      Overrides:
      setEntity in class Message
      Parameters:
      entity - The entity representation.
    • setProxyChallengeResponse

      public void setProxyChallengeResponse(ChallengeResponse response)
      Description copied from class: Request
      Sets the authentication response sent by a client to a proxy. Note that when used with HTTP connectors, this property maps to the "Proxy-Authorization" header.
      Overrides:
      setProxyChallengeResponse in class Request
      Parameters:
      response - The authentication response sent by a client to a proxy.
    • setRecipientsInfo

      public void setRecipientsInfo(List<RecipientInfo> recipientsInfo)
      Description copied from class: Message
      Sets the modifiable list of intermediary recipients. Note that when used with HTTP connectors, this property maps to the "Via" headers. This method clears the current list and adds all entries in the parameter list.
      Overrides:
      setRecipientsInfo in class Message
      Parameters:
      recipientsInfo - A list of intermediary recipients.
    • setWarnings

      public void setWarnings(List<Warning> warnings)
      Description copied from class: Message
      Sets the additional warnings information. Note that when used with HTTP connectors, this property maps to the "Warning" headers. This method clears the current list and adds all entries in the parameter list.
      Overrides:
      setWarnings in class Message
      Parameters:
      warnings - The warnings.