public class OkRequest extends BaseOkRequest implements Awaitable<OkResponse>, Asyncable<Consumer<OkResponse>>
call, client, request, tag
body, bodyLen, bodyOffset, charset, contentType, cookies, DEFAULT_USERAGENT, formParts, headers, ignoreHeaders, method, queryParams, queryString, queryStringEncode, url
Constructor and Description |
---|
OkRequest() |
OkRequest(okhttp3.OkHttpClient client) |
OkRequest(String url) |
OkRequest(String url,
okhttp3.OkHttpClient client) |
Modifier and Type | Method and Description |
---|---|
void |
async(Consumer<OkResponse> callback)
异步执行
|
OkRequest |
asyncFailThrows() |
OkRequest |
asyncFailThrows(boolean asyncFailThrows) |
OkResponse |
await()
同步执行
|
Consumer<OkResponse> |
getAsyncCallback() |
boolean |
isAsync() |
buildRequest, cancel, client, getCall, getClient, getRequest, getRequestMessage, getTag, setBody, setMultipartBody, tag
body, body, body, charset, contentType, contentType, cookie, cookies, format, format, formPart, formParts, getBody, getBodyLen, getBodyOffset, getCharset, getContentType, getCookies, getFormParts, getHeaders, getIgnoreHeaders, getMethod, getQueryParams, getQueryString, getUrl, header, headers, ignoreHeader, ignoreHeaders, ignoreHeaders, isNoBodyRequest, isQueryStringEncode, method, method, queryParam, queryParams, queryStringEncode, referer, toString, url, userAgent
public OkRequest()
public OkRequest(okhttp3.OkHttpClient client)
public OkRequest(String url)
public OkRequest(String url, okhttp3.OkHttpClient client)
public OkRequest asyncFailThrows(boolean asyncFailThrows)
public OkRequest asyncFailThrows()
public OkResponse await()
Awaitable
await
in interface Awaitable<OkResponse>
public void async(Consumer<OkResponse> callback)
Asyncable
async
in interface Asyncable<Consumer<OkResponse>>
callback
- 异步处理器public boolean isAsync()
public Consumer<OkResponse> getAsyncCallback()
Copyright © 2024. All rights reserved.