-
public class MobonRequest.Builder
-
-
Constructor Summary
Constructors Constructor Description MobonRequest.Builder()
-
Method Summary
Modifier and Type Method Description MobonRequest.Builderurl(HttpUrl url)MobonRequest.Builderurl(String url)Sets the URL target of this mobonRequest. MobonRequest.Builderurl(URL url)Sets the URL target of this mobonRequest. MobonRequest.Builderheader(String name, String value)Sets the header named {@code name}to{@code value}.MobonRequest.BuilderaddHeader(String name, String value)Adds a header with {@code name}and{@code value}.MobonRequest.BuilderremoveHeader(String name)Removes all headers named {@code name}on this builder.MobonRequest.Builderheaders(Headers headers)Removes all headers on this builder and adds {@code headers}.MobonRequest.BuildercacheControl(CacheControl cacheControl)Sets this mobonRequest's {@code Cache-Control}header, replacing any cache control headers alreadypresent.MobonRequest.Builderget()MobonRequest.Builderhead()MobonRequest.Builderpost(RequestBody body)MobonRequest.Builderdelete(@Nullable() RequestBody body)MobonRequest.Builderdelete()MobonRequest.Builderput(RequestBody body)MobonRequest.Builderpatch(RequestBody body)MobonRequest.Buildermethod(String method, @Nullable() RequestBody body)MobonRequest.Buildertag(Object tag)Attaches {@code tag}to the mobonRequest.MobonRequestbuild()-
-
Method Detail
-
url
MobonRequest.Builder url(HttpUrl url)
-
url
MobonRequest.Builder url(String url)
Sets the URL target of this mobonRequest.
-
url
MobonRequest.Builder url(URL url)
Sets the URL target of this mobonRequest.
-
header
MobonRequest.Builder header(String name, String value)
Sets the header named
{@code name}to{@code value}. If this mobonRequest already has any headerswith that name, they are all replaced.
-
addHeader
MobonRequest.Builder addHeader(String name, String value)
Adds a header with
{@code name}and{@code value}. Prefer this method for multiply-valuedheaders like "Cookie".Note that for some headers including
{@code Content-Length}and{@code Content-Encoding},OkHttp may replace{@code value}with a header derived from the mobonRequest body.
-
removeHeader
MobonRequest.Builder removeHeader(String name)
Removes all headers named
{@code name}on this builder.
-
headers
MobonRequest.Builder headers(Headers headers)
Removes all headers on this builder and adds
{@code headers}.
-
cacheControl
MobonRequest.Builder cacheControl(CacheControl cacheControl)
Sets this mobonRequest's
{@code Cache-Control}header, replacing any cache control headers alreadypresent. If{@code cacheControl}doesn't define any directives, this clears this mobonRequest'scache-control headers.
-
get
MobonRequest.Builder get()
-
head
MobonRequest.Builder head()
-
post
MobonRequest.Builder post(RequestBody body)
-
delete
MobonRequest.Builder delete(@Nullable() RequestBody body)
-
delete
MobonRequest.Builder delete()
-
put
MobonRequest.Builder put(RequestBody body)
-
patch
MobonRequest.Builder patch(RequestBody body)
-
method
MobonRequest.Builder method(String method, @Nullable() RequestBody body)
-
tag
MobonRequest.Builder tag(Object tag)
Attaches
{@code tag}to the mobonRequest. It can be used later to cancel the mobonRequest. If the tagis unspecified or null, the mobonRequest is canceled by using the mobonRequest itself as the tag.
-
build
MobonRequest build()
-
-
-
-