Constructor and Description |
---|
Request.Builder() |
Modifier and Type | Method and Description |
---|---|
Request.Builder |
addHeader(String name,
String value)
Adds a header with
name and value . |
Request |
build() |
Request.Builder |
delete() |
Request.Builder |
get() |
Request.Builder |
head() |
Request.Builder |
header(String name,
String value)
Sets the header named
name to value . |
Request.Builder |
headers(Headers headers)
Removes all headers on this builder and adds
headers . |
Request.Builder |
method(String method,
RequestBody body) |
Request.Builder |
patch(RequestBody body) |
Request.Builder |
post(RequestBody body) |
Request.Builder |
put(RequestBody body) |
Request.Builder |
removeHeader(String name) |
Request.Builder |
tag(Object tag)
Attaches
tag to the request. |
Request.Builder |
url(String url) |
Request.Builder |
url(URL url) |
public Request.Builder url(String url)
public Request.Builder url(URL url)
public Request.Builder header(String name, String value)
name
to value
. If this request
already has any headers with that name, they are all replaced.public Request.Builder addHeader(String name, String value)
name
and value
. Prefer this method for
multiply-valued headers like "Cookie".public Request.Builder removeHeader(String name)
public Request.Builder headers(Headers headers)
headers
.public Request.Builder get()
public Request.Builder head()
public Request.Builder post(RequestBody body)
public Request.Builder delete()
public Request.Builder put(RequestBody body)
public Request.Builder patch(RequestBody body)
public Request.Builder method(String method, RequestBody body)
public Request.Builder tag(Object tag)
tag
to the request. It can be used later to cancel the
request. If the tag is unspecified or null, the request is canceled by
using the request itself as the tag.public Request build()
Copyright © 2014. All Rights Reserved.