public abstract class RequestBodySerializer
extends java.lang.Object
构造器和说明 |
---|
RequestBodySerializer() |
限定符和类型 | 方法和说明 |
---|---|
abstract okhttp3.RequestBody |
body()
将请求体转换成 ResponseBody
|
static RequestBodySerializer |
bytes(java.lang.String contentType,
byte[] content)
Returns a new request body that transmits
content . |
static RequestBodySerializer |
bytes(java.lang.String contentType,
byte[] content,
long offset,
long byteCount) |
static RequestBodySerializer |
file(java.lang.String contentType,
java.io.File file) |
static RequestBodySerializer |
file(java.lang.String contentType,
java.io.File file,
long offset,
long length) |
static RequestBodySerializer |
multiPart(MultipartStreamRequestBody multipartStreamRequestBody) |
static RequestBodySerializer |
stream(java.lang.String contentType,
java.io.File tmpFile,
java.io.InputStream inputStream) |
static RequestBodySerializer |
stream(java.lang.String contentType,
java.io.File tmpFile,
java.io.InputStream inputStream,
long offset,
long length) |
static RequestBodySerializer |
string(java.lang.String contentType,
okio.ByteString content)
Returns a new request body that transmits
content . |
static RequestBodySerializer |
string(java.lang.String contentType,
java.lang.String content)
Returns a new request body that transmits
content . |
static RequestBodySerializer |
uri(java.lang.String contentType,
android.net.Uri uri,
android.content.Context context) |
static RequestBodySerializer |
uri(java.lang.String contentType,
android.net.Uri uri,
android.content.Context context,
long offset,
long length) |
static RequestBodySerializer |
url(java.lang.String contentType,
java.net.URL url) |
static RequestBodySerializer |
url(java.lang.String contentType,
java.net.URL url,
long offset,
long length) |
static RequestBodySerializer |
wrap(okhttp3.RequestBody body) |
public abstract okhttp3.RequestBody body()
public static RequestBodySerializer wrap(okhttp3.RequestBody body)
public static RequestBodySerializer string(java.lang.String contentType, java.lang.String content)
content
. If contentType
is non-null
and lacks a charset, this will use UTF-8.public static RequestBodySerializer string(java.lang.String contentType, okio.ByteString content)
content
.public static RequestBodySerializer bytes(java.lang.String contentType, byte[] content)
content
.public static RequestBodySerializer bytes(java.lang.String contentType, byte[] content, long offset, long byteCount)
public static RequestBodySerializer file(java.lang.String contentType, java.io.File file)
public static RequestBodySerializer file(java.lang.String contentType, java.io.File file, long offset, long length)
public static RequestBodySerializer url(java.lang.String contentType, java.net.URL url)
public static RequestBodySerializer url(java.lang.String contentType, java.net.URL url, long offset, long length)
public static RequestBodySerializer uri(java.lang.String contentType, android.net.Uri uri, android.content.Context context)
public static RequestBodySerializer uri(java.lang.String contentType, android.net.Uri uri, android.content.Context context, long offset, long length)
public static RequestBodySerializer stream(java.lang.String contentType, java.io.File tmpFile, java.io.InputStream inputStream)
public static RequestBodySerializer stream(java.lang.String contentType, java.io.File tmpFile, java.io.InputStream inputStream, long offset, long length)
public static RequestBodySerializer multiPart(MultipartStreamRequestBody multipartStreamRequestBody)