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 TypeMethodDescriptionbooleanDeprecated.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.longDeprecated.Deprecated.Deprecated.getPath()Deprecated.intgetPort()Deprecated.Deprecated.getQuery()Deprecated.<T extends Request.RequestListener>
List<T> getRequestListeners(Class<T> type) Deprecated.Deprecated.getTag()Deprecated.longDeprecated.Deprecated.getURI()Deprecated.Deprecated.Deprecated.header(HttpHeader header, String value) Deprecated.Adds the givenvalueto the specifiedheader.Deprecated.idleTimeout(long timeout, TimeUnit unit) Deprecated.booleanDeprecated.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.voidsend(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:RequestSpecifies 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:
getVersionin interfaceRequest- Returns:
- the HTTP version of this request, such as "HTTP/1.1"
-
version
Deprecated. -
param
Deprecated.Description copied from interface:RequestAdds 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:RequestAdds the given
valueto the specifiedheader.Multiple calls with the same parameters will add multiple values; use the value
nullto remove the header completely. -
getCookies
Deprecated.- Specified by:
getCookiesin interfaceRequest- Returns:
- the cookies associated with this request
-
cookie
Deprecated. -
tag
Deprecated.Description copied from interface:RequestTags 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:
getAttributesin interfaceRequest- Returns:
- the attributes of this request
-
getHeaders
Deprecated.- Specified by:
getHeadersin interfaceRequest- Returns:
- the headers of this request
-
getRequestListeners
Deprecated.- Specified by:
getRequestListenersin 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:
onRequestQueuedin interfaceRequest- Parameters:
listener- a listener for request queued event- Returns:
- this request object
-
onRequestBegin
Deprecated.- Specified by:
onRequestBeginin interfaceRequest- Parameters:
listener- a listener for request begin event- Returns:
- this request object
-
onRequestHeaders
Deprecated.- Specified by:
onRequestHeadersin interfaceRequest- Parameters:
listener- a listener for request headers event- Returns:
- this request object
-
onRequestCommit
Deprecated.- Specified by:
onRequestCommitin interfaceRequest- Parameters:
listener- a listener for request commit event- Returns:
- this request object
-
onRequestContent
Deprecated.- Specified by:
onRequestContentin interfaceRequest- Parameters:
listener- a listener for request content events- Returns:
- this request object
-
onRequestSuccess
Deprecated.- Specified by:
onRequestSuccessin interfaceRequest- Parameters:
listener- a listener for request success event- Returns:
- this request object
-
onRequestFailure
Deprecated.- Specified by:
onRequestFailurein interfaceRequest- Parameters:
listener- a listener for request failure event- Returns:
- this request object
-
onResponseBegin
Deprecated.- Specified by:
onResponseBeginin interfaceRequest- Parameters:
listener- a listener for response begin event- Returns:
- this request object
-
onResponseHeader
Deprecated.- Specified by:
onResponseHeaderin interfaceRequest- Parameters:
listener- a listener for response header event- Returns:
- this request object
-
onResponseHeaders
Deprecated.- Specified by:
onResponseHeadersin interfaceRequest- Parameters:
listener- a listener for response headers event- Returns:
- this request object
-
onResponseContent
Deprecated.- Specified by:
onResponseContentin interfaceRequest- Parameters:
listener- a consuming listener for response content events- Returns:
- this request object
-
onResponseContentAsync
Deprecated.- Specified by:
onResponseContentAsyncin interfaceRequest- Parameters:
listener- an asynchronous listener for response content events- Returns:
- this request object
-
onResponseContentDemanded
Deprecated.- Specified by:
onResponseContentDemandedin interfaceRequest- Parameters:
listener- an asynchronous listener for response content events- Returns:
- this request object
-
onResponseSuccess
Deprecated.- Specified by:
onResponseSuccessin interfaceRequest- Parameters:
listener- a listener for response success event- Returns:
- this request object
-
onResponseFailure
Deprecated.- Specified by:
onResponseFailurein interfaceRequest- Parameters:
listener- a listener for response failure event- Returns:
- this request object
-
onComplete
Deprecated.- Specified by:
onCompletein 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
listeneris invoked for every pushed resource. The parameters to theBiFunctionare this request and the synthesized request for the pushed resource. TheBiFunctionshould return aCompleteListenerthat may also implement other listener interfaces to be notified of various response events, ornullto 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:
getContentin interfaceRequest- Returns:
- the content provider of this request
-
content
Deprecated. -
content
Deprecated. -
file
Deprecated.Description copied from interface:RequestShortcut method to specify a file as a content for this request, with the default content type of "application/octect-stream".- Specified by:
filein 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:RequestShortcut method to specify a file as a content for this request, with the given content type.- Specified by:
filein 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:
isFollowRedirectsin interfaceRequest- Returns:
- whether this request follows redirects
-
followRedirects
Deprecated.- Specified by:
followRedirectsin interfaceRequest- Parameters:
follow- whether this request follows redirects- Returns:
- this request object
-
getIdleTimeout
public long getIdleTimeout()Deprecated.- Specified by:
getIdleTimeoutin interfaceRequest- Returns:
- the idle timeout for this request, in milliseconds
-
idleTimeout
Deprecated.- Specified by:
idleTimeoutin interfaceRequest- Parameters:
timeout- the idle timeout for this requestunit- the idle timeout unit- Returns:
- this request object
-
getTimeout
public long getTimeout()Deprecated.- Specified by:
getTimeoutin 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:RequestSends 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.Listeneror a utility listener such asInputStreamResponseListener.The method returns when the
complete eventis fired.- Specified by:
sendin interfaceRequest- Returns:
- a
ContentResponsefor this request - Throws:
InterruptedException- if send thread is interruptedTimeoutException- if send times outExecutionException- if execution fails- See Also:
-
send
Deprecated.Description copied from interface:RequestSends 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.CompleteListenerbut 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:RequestAttempts to abort the send of this request. -
getAbortCause
Deprecated.- Specified by:
getAbortCausein interfaceRequest- Returns:
- the abort cause passed to
Request.abort(Throwable), or null if this request has not been aborted
-
toString
Deprecated.
-