Class HttpRequest


  • public class HttpRequest
    extends Request
    Request wrapper for server HTTP calls.
    • Field Detail

      • accessControlRequestHeadersAdded

        private volatile boolean accessControlRequestHeadersAdded
        Indicates if the access control data for request headers was parsed and added
      • accessControlRequestMethodAdded

        private volatile boolean accessControlRequestMethodAdded
        Indicates if the access control data for request methods was parsed and added
      • cacheDirectivesAdded

        private volatile boolean cacheDirectivesAdded
        Indicates if the cache control data was parsed and added.
      • clientAdded

        private volatile boolean clientAdded
        Indicates if the client data was parsed and added.
      • conditionAdded

        private volatile boolean conditionAdded
        Indicates if the conditions were parsed and added.
      • context

        private volatile Context context
        The context of the HTTP server connector that issued the call.
      • cookiesAdded

        private volatile boolean cookiesAdded
        Indicates if the cookies were parsed and added.
      • entityAdded

        private volatile boolean entityAdded
        Indicates if the request entity was added.
      • httpCall

        private volatile ServerCall httpCall
        The low-level HTTP call.
      • proxySecurityAdded

        private volatile boolean proxySecurityAdded
        Indicates if the proxy security data was parsed and added.
      • rangesAdded

        private volatile boolean rangesAdded
        Indicates if the ranges data was parsed and added.
      • recipientsInfoAdded

        private volatile boolean recipientsInfoAdded
        Indicates if the recipients info was parsed and added.
      • referrerAdded

        private volatile boolean referrerAdded
        Indicates if the referrer was parsed and added.
      • securityAdded

        private volatile boolean securityAdded
        Indicates if the security data was parsed and added.
      • warningsAdded

        private volatile boolean warningsAdded
        Indicates if the warning data was parsed and added.
    • Constructor Detail

      • 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 Detail

      • addHeader

        @Deprecated
        public static void addHeader​(Request request,
                                     java.lang.String headerName,
                                     java.lang.String headerValue)
        Deprecated.
        Use Message.getHeaders() directly instead.
        Adds a new header to the given request.
        Parameters:
        request - The request to update.
        headerName - The header name to add.
        headerValue - The header value to add.
      • 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 java.io.IOException
        Description copied from class: Message
        Asks the underlying connector to immediately flush the network buffers.
        Overrides:
        flushBuffers in class Message
        Throws:
        java.io.IOException
      • getAccessControlRequestHeaders

        public java.util.Set<java.lang.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 java.util.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 java.util.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 java.util.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 java.util.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​(java.util.Set<java.lang.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​(java.util.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​(java.util.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.