Class HttpRequest
- All Implemented Interfaces:
Request
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Request
Request.BeginListener, Request.CommitListener, Request.ContentListener, Request.FailureListener, Request.HeadersListener, Request.Listener, Request.QueuedListener, Request.RequestListener, Request.SuccessListener
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Attempts to abort the send of this request.Deprecated.Deprecated.Deprecated.content
(ContentProvider content) Deprecated.content
(ContentProvider content, String contentType) Deprecated.cookie
(HttpCookie cookie) Deprecated.Deprecated.Shortcut method to specify a file as a content for this request, with the default content type of "application/octect-stream".Deprecated.Shortcut method to specify a file as a content for this request, with the given content type.followRedirects
(boolean follow) Deprecated.Deprecated.getAgent()
Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.getHost()
Deprecated.long
Deprecated.Deprecated.Deprecated.getPath()
Deprecated.int
getPort()
Deprecated.Deprecated.getQuery()
Deprecated.<T extends Request.RequestListener>
List<T> getRequestListeners
(Class<T> type) Deprecated.Deprecated.getTag()
Deprecated.long
Deprecated.Deprecated.getURI()
Deprecated.Deprecated.Deprecated.header
(HttpHeader header, String value) Deprecated.Adds the givenvalue
to the specifiedheader
.Deprecated.idleTimeout
(long timeout, TimeUnit unit) Deprecated.boolean
Deprecated.listener
(Request.Listener listener) Deprecated.Deprecated.method
(HttpMethod method) Deprecated.onComplete
(Response.CompleteListener listener) Deprecated.onRequestBegin
(Request.BeginListener listener) Deprecated.onRequestCommit
(Request.CommitListener listener) Deprecated.onRequestContent
(Request.ContentListener listener) Deprecated.onRequestFailure
(Request.FailureListener listener) Deprecated.onRequestHeaders
(Request.HeadersListener listener) Deprecated.onRequestQueued
(Request.QueuedListener listener) Deprecated.onRequestSuccess
(Request.SuccessListener listener) Deprecated.onResponseBegin
(Response.BeginListener listener) Deprecated.onResponseContent
(Response.ContentListener listener) Deprecated.Deprecated.Deprecated.onResponseFailure
(Response.FailureListener listener) Deprecated.onResponseHeader
(Response.HeaderListener listener) Deprecated.onResponseHeaders
(Response.HeadersListener listener) Deprecated.onResponseSuccess
(Response.SuccessListener listener) Deprecated.Deprecated.Adds a URI query parameter with the given name and value.Deprecated.Specifies the URI path - and possibly the query - of this request.port
(int port) Deprecated.Deprecated.Sets a listener for pushed resources.Deprecated.send()
Deprecated.Sends this request and returns the response.void
send
(Response.CompleteListener listener) Deprecated.Sends this request and asynchronously notifies the given listener for response events.Deprecated.Tags this request with the given metadata tag.Deprecated.toString()
Deprecated.trailers
(Supplier<HttpFields> trailers) Deprecated.version
(HttpVersion version) Deprecated.
-
Method Details
-
getConversation
Deprecated. -
getScheme
Deprecated. -
scheme
Deprecated. -
getHost
Deprecated. -
host
Deprecated. -
getPort
public int getPort()Deprecated. -
port
Deprecated. -
getMethod
Deprecated. -
method
Deprecated. -
method
Deprecated. -
getPath
Deprecated. -
path
Deprecated.Description copied from interface:Request
Specifies the URI path - and possibly the query - of this request. If the query part is specified, parameter values must be properlyUTF-8 URL encoded
. For example, if the value for parameter "currency" is the euro symbol € then the query string for this parameter must be "currency=%E2%82%AC". For transparent encoding of parameter values, useRequest.param(String, String)
. -
getQuery
Deprecated. -
getURI
Deprecated. -
getVersion
Deprecated.- Specified by:
getVersion
in interfaceRequest
- Returns:
- the HTTP version of this request, such as "HTTP/1.1"
-
version
Deprecated. -
param
Deprecated.Description copied from interface:Request
Adds a URI query parameter with the given name and value. The value isUTF-8 URL encoded
. -
getParams
Deprecated. -
getAgent
Deprecated. -
agent
Deprecated. -
accept
Deprecated. -
header
Deprecated. -
header
Deprecated.Description copied from interface:Request
Adds the given
value
to the specifiedheader
.Multiple calls with the same parameters will add multiple values; use the value
null
to remove the header completely. -
getCookies
Deprecated.- Specified by:
getCookies
in interfaceRequest
- Returns:
- the cookies associated with this request
-
cookie
Deprecated. -
tag
Deprecated.Description copied from interface:Request
Tags this request with the given metadata tag.
Each different tag will create a different destination, even if the destination origin is the same.
This is particularly useful in proxies, where requests for the same origin but from different clients may be tagged with client's metadata (e.g. the client remote address).
The tag metadata class must correctly implement
Object.hashCode()
andObject.equals(Object)
so that it can be used, along with the origin, to identify a destination. -
getTag
Deprecated. -
attribute
Deprecated. -
getAttributes
Deprecated.- Specified by:
getAttributes
in interfaceRequest
- Returns:
- the attributes of this request
-
getHeaders
Deprecated.- Specified by:
getHeaders
in interfaceRequest
- Returns:
- the headers of this request
-
getRequestListeners
Deprecated.- Specified by:
getRequestListeners
in interfaceRequest
- Type Parameters:
T
- the type of listener class- Parameters:
type
- the class of the listener, or null for all listeners classes- Returns:
- the listeners for request events of the given class
-
listener
Deprecated. -
onRequestQueued
Deprecated.- Specified by:
onRequestQueued
in interfaceRequest
- Parameters:
listener
- a listener for request queued event- Returns:
- this request object
-
onRequestBegin
Deprecated.- Specified by:
onRequestBegin
in interfaceRequest
- Parameters:
listener
- a listener for request begin event- Returns:
- this request object
-
onRequestHeaders
Deprecated.- Specified by:
onRequestHeaders
in interfaceRequest
- Parameters:
listener
- a listener for request headers event- Returns:
- this request object
-
onRequestCommit
Deprecated.- Specified by:
onRequestCommit
in interfaceRequest
- Parameters:
listener
- a listener for request commit event- Returns:
- this request object
-
onRequestContent
Deprecated.- Specified by:
onRequestContent
in interfaceRequest
- Parameters:
listener
- a listener for request content events- Returns:
- this request object
-
onRequestSuccess
Deprecated.- Specified by:
onRequestSuccess
in interfaceRequest
- Parameters:
listener
- a listener for request success event- Returns:
- this request object
-
onRequestFailure
Deprecated.- Specified by:
onRequestFailure
in interfaceRequest
- Parameters:
listener
- a listener for request failure event- Returns:
- this request object
-
onResponseBegin
Deprecated.- Specified by:
onResponseBegin
in interfaceRequest
- Parameters:
listener
- a listener for response begin event- Returns:
- this request object
-
onResponseHeader
Deprecated.- Specified by:
onResponseHeader
in interfaceRequest
- Parameters:
listener
- a listener for response header event- Returns:
- this request object
-
onResponseHeaders
Deprecated.- Specified by:
onResponseHeaders
in interfaceRequest
- Parameters:
listener
- a listener for response headers event- Returns:
- this request object
-
onResponseContent
Deprecated.- Specified by:
onResponseContent
in interfaceRequest
- Parameters:
listener
- a consuming listener for response content events- Returns:
- this request object
-
onResponseContentAsync
Deprecated.- Specified by:
onResponseContentAsync
in interfaceRequest
- Parameters:
listener
- an asynchronous listener for response content events- Returns:
- this request object
-
onResponseContentDemanded
Deprecated.- Specified by:
onResponseContentDemanded
in interfaceRequest
- Parameters:
listener
- an asynchronous listener for response content events- Returns:
- this request object
-
onResponseSuccess
Deprecated.- Specified by:
onResponseSuccess
in interfaceRequest
- Parameters:
listener
- a listener for response success event- Returns:
- this request object
-
onResponseFailure
Deprecated.- Specified by:
onResponseFailure
in interfaceRequest
- Parameters:
listener
- a listener for response failure event- Returns:
- this request object
-
onComplete
Deprecated.- Specified by:
onComplete
in interfaceRequest
- Parameters:
listener
- a listener for complete event- Returns:
- this request object
-
pushListener
Deprecated.Sets a listener for pushed resources.
When resources are pushed from the server, the given
listener
is invoked for every pushed resource. The parameters to theBiFunction
are this request and the synthesized request for the pushed resource. TheBiFunction
should return aCompleteListener
that may also implement other listener interfaces to be notified of various response events, ornull
to signal that the pushed resource should be canceled.- Parameters:
listener
- a listener for pushed resource events- Returns:
- this request object
-
trailers
Deprecated. -
getContent
Deprecated.- Specified by:
getContent
in interfaceRequest
- Returns:
- the content provider of this request
-
content
Deprecated. -
content
Deprecated. -
file
Deprecated.Description copied from interface:Request
Shortcut method to specify a file as a content for this request, with the default content type of "application/octect-stream".- Specified by:
file
in interfaceRequest
- Parameters:
file
- the file to upload- Returns:
- this request object
- Throws:
IOException
- if the file does not exist or cannot be read
-
file
Deprecated.Description copied from interface:Request
Shortcut method to specify a file as a content for this request, with the given content type.- Specified by:
file
in interfaceRequest
- Parameters:
file
- the file to uploadcontentType
- the content type of the file- Returns:
- this request object
- Throws:
IOException
- if the file does not exist or cannot be read
-
isFollowRedirects
public boolean isFollowRedirects()Deprecated.- Specified by:
isFollowRedirects
in interfaceRequest
- Returns:
- whether this request follows redirects
-
followRedirects
Deprecated.- Specified by:
followRedirects
in interfaceRequest
- Parameters:
follow
- whether this request follows redirects- Returns:
- this request object
-
getIdleTimeout
public long getIdleTimeout()Deprecated.- Specified by:
getIdleTimeout
in interfaceRequest
- Returns:
- the idle timeout for this request, in milliseconds
-
idleTimeout
Deprecated.- Specified by:
idleTimeout
in interfaceRequest
- Parameters:
timeout
- the idle timeout for this requestunit
- the idle timeout unit- Returns:
- this request object
-
getTimeout
public long getTimeout()Deprecated.- Specified by:
getTimeout
in interfaceRequest
- Returns:
- the total timeout for this request, in milliseconds; zero or negative if the timeout is disabled
-
timeout
Deprecated. -
send
Deprecated.Description copied from interface:Request
Sends this request and returns the response.This method should be used when a simple blocking semantic is needed, and when it is known that the response content can be buffered without exceeding memory constraints.
For example, this method is not appropriate to download big files from a server; consider using
Request.send(Response.CompleteListener)
instead, passing your ownResponse.Listener
or a utility listener such asInputStreamResponseListener
.The method returns when the
complete event
is fired.- Specified by:
send
in interfaceRequest
- Returns:
- a
ContentResponse
for this request - Throws:
InterruptedException
- if send thread is interruptedTimeoutException
- if send times outExecutionException
- if execution fails- See Also:
-
send
Deprecated.Description copied from interface:Request
Sends this request and asynchronously notifies the given listener for response events.
This method should be used when the application needs to be notified of the various response events as they happen, or when the application needs to efficiently manage the response content.
The listener passed to this method may implement not only
Response.CompleteListener
but also other response listener interfaces, and all the events implemented will be notified. This allows application code to write a single listener class to handle all relevant events. -
getPushListener
Deprecated. -
getTrailers
Deprecated. -
abort
Deprecated.Description copied from interface:Request
Attempts to abort the send of this request. -
getAbortCause
Deprecated.- Specified by:
getAbortCause
in interfaceRequest
- Returns:
- the abort cause passed to
Request.abort(Throwable)
, or null if this request has not been aborted
-
toString
Deprecated.
-