类 Request.Builder
java.lang.Object
com.lark.oapi.okhttp.Request.Builder
- 封闭类:
Request
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Adds a header withnameandvalue.build()cacheControl(CacheControl cacheControl) Sets this request'sCache-Controlheader, replacing any cache control headers already present.delete()delete(RequestBody body) get()head()Sets the header namednametovalue.Removes all headers on this builder and addsheaders.method(String method, RequestBody body) patch(RequestBody body) post(RequestBody body) put(RequestBody body) removeHeader(String name) Removes all headers namednameon this builder.<T> Request.BuilderAttachestagto the request usingtypeas a key.Attachestagto the request usingObject.classas a key.Sets the URL target of this request.Sets the URL target of this request.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
url
-
url
Sets the URL target of this request.- 抛出:
IllegalArgumentException- ifurlis not a valid HTTP or HTTPS URL. Avoid this exception by callingHttpUrl.parse(java.lang.String); it returns null for invalid URLs.
-
url
Sets the URL target of this request.- 抛出:
IllegalArgumentException- if the scheme ofurlis nothttporhttps.
-
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".Note that for some headers including
Content-LengthandContent-Encoding, OkHttp may replacevaluewith a header derived from the request body. -
removeHeader
Removes all headers namednameon this builder. -
headers
Removes all headers on this builder and addsheaders. -
cacheControl
Sets this request'sCache-Controlheader, replacing any cache control headers already present. IfcacheControldoesn't define any directives, this clears this request's cache-control headers. -
get
-
head
-
post
-
delete
-
delete
-
put
-
patch
-
method
-
tag
Attachestagto the request usingObject.classas a key. -
tag
Attachestagto the request usingtypeas a key. Tags can be read from a request usingRequest.tag(). Use null to remove any existing tag assigned fortype.Use this API to attach timing, debugging, or other application data to a request so that you may read it in interceptors, event listeners, or callbacks.
-
build
-