Package com.squareup.okhttp
Class Request.Builder
java.lang.Object
com.squareup.okhttp.Request.Builder
- Enclosing class:
- Request
public static class Request.Builder extends Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Request.BuilderaddHeader(String name, String value)Adds a header withnameandvalue.Requestbuild()Request.Builderget()Request.Builderhead()Request.Builderheader(String name, String value)Sets the header namednametovalue.Request.Buildermethod(String method, Request.Body body)Request.Builderpost(Request.Body body)Request.Builderput(Request.Body body)Request.Buildertag(Object tag)Attachestagto the request.Request.Builderurl(String url)Request.Builderurl(URL url)
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
url
-
url
-
header
Sets the header namednametovalue. If this request already has any headers with that name, they are all replaced. -
addHeader
Adds a header withnameandvalue. Prefer this method for multiply-valued headers like "Cookie". -
get
-
head
-
post
-
put
-
method
-
tag
Attachestagto 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. -
build
-