public final class Request
extends java.lang.Object
body
is null or itself
immutable.Modifier and Type | Class and Description |
---|---|
static class |
Request.Builder |
Modifier and Type | Field and Description |
---|---|
(package private) RequestBody |
body |
private CacheControl |
cacheControl |
(package private) Headers |
headers |
(package private) java.lang.String |
method |
(package private) java.util.Map<java.lang.Class<?>,java.lang.Object> |
tags |
(package private) HttpUrl |
url |
Constructor and Description |
---|
Request(Request.Builder builder) |
Modifier and Type | Method and Description |
---|---|
RequestBody |
body() |
CacheControl |
cacheControl()
Returns the cache control directives for this response.
|
java.lang.String |
header(java.lang.String name) |
Headers |
headers() |
java.util.List<java.lang.String> |
headers(java.lang.String name) |
boolean |
isHttps() |
java.lang.String |
method() |
Request.Builder |
newBuilder() |
java.lang.Object |
tag()
Returns the tag attached with
Object.class as a key, or null if no tag is attached with
that key. |
<T> T |
tag(java.lang.Class<? extends T> type)
Returns the tag attached with
type as a key, or null if no tag is attached with that
key. |
java.lang.String |
toString() |
HttpUrl |
url() |
final HttpUrl url
final java.lang.String method
final Headers headers
@Nullable final RequestBody body
final java.util.Map<java.lang.Class<?>,java.lang.Object> tags
@Nullable private volatile CacheControl cacheControl
Request(Request.Builder builder)
public HttpUrl url()
public java.lang.String method()
public Headers headers()
@Nullable public java.lang.String header(java.lang.String name)
public java.util.List<java.lang.String> headers(java.lang.String name)
@Nullable public RequestBody body()
@Nullable public java.lang.Object tag()
Object.class
as a key, or null if no tag is attached with
that key.
Prior to OkHttp 3.11, this method never returned null if no tag was attached. Instead it
returned either this request, or the request upon which this request was derived with newBuilder()
.
@Nullable public <T> T tag(java.lang.Class<? extends T> type)
type
as a key, or null if no tag is attached with that
key.public Request.Builder newBuilder()
public CacheControl cacheControl()
Cache-Control
header.public boolean isHttps()
public java.lang.String toString()
toString
in class java.lang.Object