public final class HttpRequest extends HttpRequest implements HttpMessage
HttpMessage.DiscardedEntity, HttpMessage.HttpMessageScalaDSLSugar, HttpMessage.HttpMessageScalaDSLSugar$HttpMessage.MessageTransformations<Self>| Constructor and Description |
|---|
HttpRequest(HttpMethod method,
Uri uri,
scala.collection.immutable.Seq<HttpHeader> headers,
scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes,
RequestEntity entity,
HttpProtocol protocol) |
HttpRequest(HttpMethod method,
Uri uri,
scala.collection.immutable.Seq<HttpHeader> headers,
RequestEntity entity,
HttpProtocol protocol)
Deprecated.
use the constructor that includes an attributes parameter instead. Since Akka HTTP 10.2.0.
|
| Modifier and Type | Method and Description |
|---|---|
HttpMethod |
_1() |
Uri |
_2() |
scala.collection.immutable.Seq<HttpHeader> |
_3() |
RequestEntity |
_4() |
HttpProtocol |
_5() |
static HttpRequest |
apply(HttpMethod method,
Uri uri,
scala.collection.immutable.Seq<HttpHeader> headers,
RequestEntity entity,
HttpProtocol protocol) |
scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> |
attributes() |
boolean |
canBeRetried()
Determines whether this request can be safely retried, which is the case only of the request method is idempotent.
|
scala.collection.immutable.Seq<HttpCookiePair> |
cookies()
All cookies provided by the client in one or more
Cookie headers. |
HttpRequest |
copy(HttpMethod method,
Uri uri,
scala.collection.immutable.Seq<HttpHeader> headers,
RequestEntity entity,
HttpProtocol protocol)
Deprecated.
Use the `withXYZ` methods instead. Kept for binary compatibility. Since Akka HTTP 10.2.0.
|
Uri |
effectiveUri(boolean securedConnection,
Host defaultHostHeader)
Resolve this request's URI according to the logic defined at
http://tools.ietf.org/html/rfc7230#section-5.5
Throws an
IllegalUriException if the URI is relative and the headers don't
include a valid pekko.http.scaladsl.model.headers.Host header or if URI authority and pekko.http.scaladsl.model.headers.Host header don't match. |
RequestEntity |
entity()
Returns the entity of this request.
|
boolean |
equals(java.lang.Object obj) |
Uri |
getUri()
Java API
|
int |
hashCode() |
scala.collection.immutable.Seq<HttpHeader> |
headers() |
boolean |
isRequest()
Is this instance a request.
|
boolean |
isResponse()
Is this instance a response.
|
HttpRequest |
mapEntity(scala.Function1<RequestEntity,RequestEntity> f) |
HttpMethod |
method()
Returns the Http method of this request.
|
HttpProtocol |
protocol()
The protocol of this message.
|
HttpRequest |
self() |
java.lang.String |
toString() |
<M> HttpRequest |
transformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString>,M> transformer)
Returns a copy of Self message after applying the given transformation
|
static OptHttpRequest |
unapply(HttpRequest any) |
Uri |
uri() |
static void |
verifyUri(Uri uri)
Verifies that the given
Uri is non-empty and has either scheme http, https, ws, wss or no scheme at all. |
HttpRequest |
withAttributes(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes)
Returns a copy of this message with the attributes set to the given ones.
|
HttpRequest |
withEffectiveUri(boolean securedConnection,
Host defaultHostHeader)
Returns a copy of this request with the URI resolved according to the logic defined at
http://tools.ietf.org/html/rfc7230#section-5.5
|
HttpRequest |
withEntity(RequestEntity entity)
Returns a copy of this instance with a new entity.
|
HttpRequest |
withEntity(RequestEntity entity)
Returns a copy of this message with the entity set to the given one.
|
HttpRequest |
withHeaders(scala.collection.immutable.Seq<HttpHeader> headers)
Returns a copy of this message with the list of headers set to the given ones.
|
HttpRequest |
withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers,
RequestEntity entity)
Returns a copy of this message with the entity and headers set to the given ones.
|
HttpRequest |
withMethod(HttpMethod method)
Returns a copy of this instance with a new method.
|
HttpRequest |
withProtocol(HttpProtocol protocol)
Returns a copy of this message with a new protocol.
|
HttpRequest |
withUri(java.lang.String path)
Returns a copy of this instance with a new Uri.
|
HttpRequest |
withUri(Uri uri) |
HttpRequest |
withUri(Uri uri)
Java API
|
create, create, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUTclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAttribute, addCredentials, addHeader, addHeaders, attribute, connectionCloseExpected, discardEntityBytes, discardEntityBytes, encoding, getAttribute, getHeader, getHeader, getHeaders, getHeaders, header, headers, mapAttributes, mapHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, toStrict, toStrict, withDefaultHeaders, withDefaultHeaders, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders, withHeadersaddAttribute, addCredentials, addHeader, addHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaderspublic HttpRequest(HttpMethod method, Uri uri, scala.collection.immutable.Seq<HttpHeader> headers, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes, RequestEntity entity, HttpProtocol protocol)
public HttpRequest(HttpMethod method, Uri uri, scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity, HttpProtocol protocol)
public static void verifyUri(Uri uri)
Uri is non-empty and has either scheme http, https, ws, wss or no scheme at all.
If any of these conditions is not met the method throws an IllegalUriException.uri - (undocumented)public static HttpRequest apply(HttpMethod method, Uri uri, scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity, HttpProtocol protocol)
public static OptHttpRequest unapply(HttpRequest any)
public HttpMethod method()
HttpRequestmethod in class HttpRequestpublic Uri uri()
public scala.collection.immutable.Seq<HttpHeader> headers()
public scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes()
public RequestEntity entity()
HttpRequestentity in interface HttpMessageentity in class HttpRequestpublic HttpProtocol protocol()
HttpMessageprotocol in interface HttpMessagepublic HttpRequest self()
public boolean isRequest()
HttpMessageisRequest in interface HttpMessagepublic boolean isResponse()
HttpMessageisResponse in interface HttpMessagepublic Uri effectiveUri(boolean securedConnection, Host defaultHostHeader)
Throws an IllegalUriException if the URI is relative and the headers don't
include a valid pekko.http.scaladsl.model.headers.Host header or if URI authority and pekko.http.scaladsl.model.headers.Host header don't match.
securedConnection - (undocumented)defaultHostHeader - (undocumented)public HttpRequest withEffectiveUri(boolean securedConnection, Host defaultHostHeader)
securedConnection - (undocumented)defaultHostHeader - (undocumented)public scala.collection.immutable.Seq<HttpCookiePair> cookies()
Cookie headers.public boolean canBeRetried()
public HttpRequest withHeaders(scala.collection.immutable.Seq<HttpHeader> headers)
HttpMessagepublic HttpRequest withAttributes(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes)
HttpMessagepublic HttpRequest withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity)
HttpMessagepublic HttpRequest withEntity(RequestEntity entity)
HttpRequestwithEntity in interface HttpMessage.MessageTransformations<HttpRequest>withEntity in class HttpRequestpublic HttpRequest withEntity(RequestEntity entity)
HttpMessagepublic HttpRequest mapEntity(scala.Function1<RequestEntity,RequestEntity> f)
public HttpRequest withMethod(HttpMethod method)
HttpRequestwithMethod in class HttpRequestpublic HttpRequest withProtocol(HttpProtocol protocol)
HttpMessage.MessageTransformationswithProtocol in interface HttpMessage.MessageTransformations<HttpRequest>public HttpRequest withUri(java.lang.String path)
HttpRequestwithUri in class HttpRequestpublic HttpRequest withUri(Uri uri)
public <M> HttpRequest transformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString>,M> transformer)
HttpMessage.MessageTransformationstransformEntityDataBytes in interface HttpMessage.MessageTransformations<HttpRequest>public Uri getUri()
getUri in class HttpRequestpublic HttpRequest withUri(Uri uri)
withUri in class HttpRequestpublic HttpRequest copy(HttpMethod method, Uri uri, scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity, HttpProtocol protocol)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic HttpMethod _1()
public Uri _2()
public scala.collection.immutable.Seq<HttpHeader> _3()
public RequestEntity _4()
public HttpProtocol _5()