public class OkAsyncUpload extends BaseOkRequest implements 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 |
---|
OkAsyncUpload(String url) |
OkAsyncUpload(String url,
okhttp3.OkHttpClient client) |
Modifier and Type | Method and Description |
---|---|
void |
async(Consumer<OkResponse> callback)
异步执行
|
OkAsyncUpload |
asyncFailThrows() |
OkAsyncUpload |
asyncFailThrows(boolean asyncFailThrows) |
BaseHttpRequest |
body(byte[] body) |
BaseHttpRequest |
body(byte[] body,
int offset,
int len) |
BaseHttpRequest |
body(String body) |
BaseHttpRequest |
contentType(HttpContentType contentType) |
BaseHttpRequest |
contentType(String contentType) |
OkAsyncUpload |
method(HttpMethod method) |
OkAsyncUpload |
method(String method) |
OkAsyncUpload |
part(HttpUploadPart part)
上传单文件
|
OkAsyncUpload |
parts(Collection<HttpUploadPart> parts)
上传多文件
|
protected void |
setBody(okhttp3.Request.Builder requestBuilder)
设置body
|
buildRequest, cancel, client, getCall, getClient, getRequest, getRequestMessage, getTag, setMultipartBody, tag
charset, 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, queryParam, queryParams, queryStringEncode, referer, toString, url, userAgent
public OkAsyncUpload(String url)
public OkAsyncUpload(String url, okhttp3.OkHttpClient client)
public OkAsyncUpload asyncFailThrows(boolean asyncFailThrows)
public OkAsyncUpload asyncFailThrows()
public OkAsyncUpload method(HttpMethod method)
method
in class BaseHttpRequest
public OkAsyncUpload method(String method)
method
in class BaseHttpRequest
public BaseHttpRequest body(String body)
body
in class BaseHttpRequest
public BaseHttpRequest body(byte[] body)
body
in class BaseHttpRequest
public BaseHttpRequest body(byte[] body, int offset, int len)
body
in class BaseHttpRequest
public BaseHttpRequest contentType(String contentType)
contentType
in class BaseHttpRequest
public BaseHttpRequest contentType(HttpContentType contentType)
contentType
in class BaseHttpRequest
public OkAsyncUpload part(HttpUploadPart part)
part
- ignorepublic OkAsyncUpload parts(Collection<HttpUploadPart> parts)
parts
- ignoreprotected void setBody(okhttp3.Request.Builder requestBuilder)
BaseOkRequest
setBody
in class BaseOkRequest
requestBuilder
- builderpublic void async(Consumer<OkResponse> callback)
Asyncable
async
in interface Asyncable<Consumer<OkResponse>>
callback
- 异步处理器Copyright © 2024. All rights reserved.