RequestBuilder

Methods
13
Fields
None

Getting one

RequestBuilder.new()
RequestBuilder.new():build():newBuilder()

Methods

MethodReturnsDescription
url(string)RequestBuilder(RequestBuilder, string) -> RequestBuilder: The URL (ws:/wss: become http:/https:); a bad one is IllegalArgumentException.
url(HttpUrl)RequestBuilder
header(string, string)RequestBuilderSet header name to value, replacing its values.
addHeader(string, string)RequestBuilderAdd a value to header name.
removeHeader(string)RequestBuilderRemove header name.
get()RequestBuilderGET.
head()RequestBuilderHEAD.
post(RequestBody)RequestBuilderPOST with body.
put(RequestBody)RequestBuilderPUT with body.
patch(RequestBody)RequestBuilderPATCH with body.
delete()RequestBuilder(RequestBuilder) -> RequestBuilder: DELETE with an empty body.
delete(RequestBody)RequestBuilder
method(string, RequestBody?)RequestBuildermethod with body (nil for none), with OkHttp's checks: POST, PUT and PATCH need a body, GET and HEAD take none.
build()RequestThe request; without a URL it is IllegalStateException.
new()RequestBuilderA GET with no URL yet.

Returned by

MethodReturnsDescription
Request.newBuilderRequestBuilderA builder holding this request.
RequestBuilderClass.newRequestBuilderA GET with no URL yet.

Method details