public final class FormBody extends RequestBody
| Modifier and Type | Class | Description |
|---|---|---|
static class |
FormBody.Builder |
| Modifier and Type | Method | Description |
|---|---|---|
long |
contentLength() |
Returns the number of bytes that will be written to
sink in a call to RequestBody.writeTo(okio.BufferedSink),
or -1 if that count is unknown. |
MediaType |
contentType() |
Returns the Content-Type header for this body.
|
String |
encodedName(int index) |
|
String |
encodedValue(int index) |
|
String |
name(int index) |
|
int |
size() |
The number of key-value pairs in this form-encoded body.
|
String |
value(int index) |
|
void |
writeTo(okio.BufferedSink sink) |
Writes the content of this request to
sink. |
public int size()
public String encodedName(int index)
public String name(int index)
public String encodedValue(int index)
public String value(int index)
public MediaType contentType()
RequestBodycontentType in class RequestBodypublic long contentLength()
RequestBodysink in a call to RequestBody.writeTo(okio.BufferedSink),
or -1 if that count is unknown.contentLength in class RequestBodypublic void writeTo(okio.BufferedSink sink)
throws IOException
RequestBodysink.writeTo in class RequestBodyIOExceptionCopyright © 2021. All rights reserved.