Package org.restlet.engine.adapter
Class HttpRequest
java.lang.Object
org.restlet.Message
org.restlet.Request
org.restlet.engine.adapter.HttpRequest
Request wrapper for server HTTP calls.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabort()Ask the connector to attempt to abort the related network connection, for example immediately closing the socket.voidAsks the underlying connector to immediately flush the network buffers.Returns the modifiable set of headers the client is willing to send in future request to this resource.Returns the method the client is willing to use in future request to this resource.Returns the cache directives.
Note that when used with HTTP connectors, this property maps to the "Cache-Control" header.Returns the authentication response sent by a client to an origin server.Returns the client-specific information.Returns the condition data applying to this call.Returns the cookies provided by the client.Returns the representation provided by the client.Returns the low-level HTTP call.Returns the authentication response sent by a client to a proxy.Returns the ranges to return from the target resource's representation.Returns the intermediary recipient information.
Note that when used with HTTP connectors, this property maps to the "Via" headers.Returns the referrer reference if available.Returns the additional warnings information.
Note that when used with HTTP connectors, this property maps to the "Warning" headers.voidsetAccessControlRequestHeaders(Set<String> accessControlRequestHeaders) Sets the set of headers the client is willing to use in future request to this resource.voidsetAccessControlRequestMethod(Method accessControlRequestMethod) Sets the method the client is willing to use in future request to this resource.voidsetChallengeResponse(ChallengeResponse response) Sets the authentication response sent by a client to an origin server.voidsetEntity(Representation entity) Sets the entity representation.voidsetProxyChallengeResponse(ChallengeResponse response) Sets the authentication response sent by a client to a proxy.voidsetRecipientsInfo(List<RecipientInfo> recipientsInfo) Sets the modifiable list of intermediary recipients.voidsetWarnings(List<Warning> warnings) Sets the additional warnings information.Methods inherited from class org.restlet.Request
commit, getCurrent, getHostRef, getMaxForwards, getMethod, getOnResponse, getOriginalRef, getProtocol, getResourceRef, getRootRef, isAsynchronous, isConfidential, isEntityAvailable, isExpectingResponse, isLoggable, isSynchronous, setClientInfo, setConditions, setCookies, setHostRef, setHostRef, setLoggable, setMaxForwards, setMethod, setOnResponse, setOriginalRef, setProtocol, setRanges, setReferrerRef, setReferrerRef, setResourceRef, setResourceRef, setRootRef, toStringMethods inherited from class org.restlet.Message
bufferEntity, getAttributes, getDate, getEntityAsText, getHeaders, getOnError, getOnSent, release, setAttributes, setCacheDirectives, setDate, setEntity, setOnError, setOnSent
-
Constructor Details
-
HttpRequest
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:RequestAsk the connector to attempt to abort the related network connection, for example immediately closing the socket. -
flushBuffers
Description copied from class:MessageAsks the underlying connector to immediately flush the network buffers.- Overrides:
flushBuffersin classMessage- Throws:
IOException
-
getAccessControlRequestHeaders
Description copied from class:RequestReturns 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:
getAccessControlRequestHeadersin classRequest- Returns:
- The headers the client is willing to send in future request to this resource. Useful for CORS support.
-
getAccessControlRequestMethod
Description copied from class:RequestReturns 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:
getAccessControlRequestMethodin classRequest- Returns:
- The method the client is willing to send in future request to this resource. Useful for CORS support.
-
getCacheDirectives
Description copied from class:MessageReturns the cache directives.
Note that when used with HTTP connectors, this property maps to the "Cache-Control" header.- Overrides:
getCacheDirectivesin classMessage- Returns:
- The cache directives.
-
getChallengeResponse
Description copied from class:RequestReturns 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:
getChallengeResponsein classRequest- Returns:
- The authentication response sent by a client to an origin server.
-
getClientInfo
Returns the client-specific information.- Overrides:
getClientInfoin classRequest- Returns:
- The client-specific information.
-
getConditions
Returns the condition data applying to this call.- Overrides:
getConditionsin classRequest- Returns:
- The condition data applying to this call.
-
getCookies
Returns the cookies provided by the client.- Overrides:
getCookiesin classRequest- Returns:
- The cookies provided by the client.
-
getEntity
Returns the representation provided by the client. -
getHttpCall
Returns the low-level HTTP call.- Returns:
- The low-level HTTP call.
-
getProxyChallengeResponse
Description copied from class:RequestReturns 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:
getProxyChallengeResponsein classRequest- Returns:
- The authentication response sent by a client to a proxy.
-
getRanges
Description copied from class:RequestReturns the ranges to return from the target resource's representation. Note that when used with HTTP connectors, this property maps to the "Range" header. -
getRecipientsInfo
Description copied from class:MessageReturns the intermediary recipient information.
Note that when used with HTTP connectors, this property maps to the "Via" headers.- Overrides:
getRecipientsInfoin classMessage- Returns:
- The intermediary recipient information.
-
getReferrerRef
Returns the referrer reference if available.- Overrides:
getReferrerRefin classRequest- Returns:
- The referrer reference.
-
getWarnings
Description copied from class:MessageReturns the additional warnings information.
Note that when used with HTTP connectors, this property maps to the "Warning" headers.- Overrides:
getWarningsin classMessage- Returns:
- The additional warnings information.
-
setAccessControlRequestHeaders
Description copied from class:RequestSets 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:
setAccessControlRequestHeadersin classRequest- Parameters:
accessControlRequestHeaders- The set of headers the client is willing to send in future request to this resource. Useful for CORS support.
-
setAccessControlRequestMethod
Description copied from class:RequestSets 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:
setAccessControlRequestMethodin classRequest- Parameters:
accessControlRequestMethod- The method the client is willing to send in future request to this resource. Useful for CORS support.
-
setChallengeResponse
Description copied from class:RequestSets 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:
setChallengeResponsein classRequest- Parameters:
response- The authentication response sent by a client to an origin server.
-
setEntity
Description copied from class:MessageSets the entity representation. -
setProxyChallengeResponse
Description copied from class:RequestSets 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:
setProxyChallengeResponsein classRequest- Parameters:
response- The authentication response sent by a client to a proxy.
-
setRecipientsInfo
Description copied from class:MessageSets 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:
setRecipientsInfoin classMessage- Parameters:
recipientsInfo- A list of intermediary recipients.
-
setWarnings
Description copied from class:MessageSets 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:
setWarningsin classMessage- Parameters:
warnings- The warnings.
-