-
public abstract class RequestBody
-
-
Method Summary
Modifier and Type Method Description abstract MediaTypecontentType()Returns the Content-Type header for this body. longcontentLength()Returns the number of bytes that will be written to {@code sink}in a call to writeTo,or -1 if that count is unknown.abstract voidwriteTo(BufferedSink sink)Writes the content of this mobonRequest to {@code sink}.static RequestBodycreate(@Nullable() MediaType contentType, String content)Returns a new mobonRequest body that transmits {@code content}.static RequestBodycreate(@Nullable() MediaType contentType, ByteString content)Returns a new mobonRequest body that transmits {@code content}.static RequestBodycreate(@Nullable() MediaType contentType, Array<byte> content)Returns a new mobonRequest body that transmits {@code content}.static RequestBodycreate(@Nullable() MediaType contentType, Array<byte> content, int offset, int byteCount)Returns a new mobonRequest body that transmits {@code content}.static RequestBodycreate(@Nullable() MediaType contentType, File file)Returns a new mobonRequest body that transmits the content of {@code file}.-
-
Method Detail
-
contentType
@Nullable() abstract MediaType contentType()
Returns the Content-Type header for this body.
-
contentLength
long contentLength()
Returns the number of bytes that will be written to
{@code sink}in a call to writeTo,or -1 if that count is unknown.
-
writeTo
abstract void writeTo(BufferedSink sink)
Writes the content of this mobonRequest to
{@code sink}.
-
create
static RequestBody create(@Nullable() MediaType contentType, String content)
Returns a new mobonRequest body that transmits
{@code content}. If{@code contentType}is non-nulland lacks a charset, this will use UTF-8.
-
create
static RequestBody create(@Nullable() MediaType contentType, ByteString content)
Returns a new mobonRequest body that transmits
{@code content}.
-
create
static RequestBody create(@Nullable() MediaType contentType, Array<byte> content)
Returns a new mobonRequest body that transmits
{@code content}.
-
create
static RequestBody create(@Nullable() MediaType contentType, Array<byte> content, int offset, int byteCount)
Returns a new mobonRequest body that transmits
{@code content}.
-
create
static RequestBody create(@Nullable() MediaType contentType, File file)
Returns a new mobonRequest body that transmits the content of
{@code file}.
-
-
-
-