@Experimental public static class Request.Body extends Object implements Serializable
Considered experimental, will most likely be made internal going forward.
Modifier and Type | Method and Description |
---|---|
byte[] |
asBytes() |
String |
asString() |
static Request.Body |
create(byte[] data) |
static Request.Body |
create(byte[] data,
Charset charset) |
static Request.Body |
create(String data) |
static Request.Body |
create(String data,
Charset charset) |
static Request.Body |
empty() |
static Request.Body |
encoded(byte[] data,
Charset charset)
Deprecated.
please use
create(byte[], Charset) |
Optional<Charset> |
getEncoding() |
boolean |
isBinary() |
int |
length() |
public int length()
public byte[] asBytes()
public String asString()
public boolean isBinary()
public static Request.Body create(String data)
public static Request.Body create(String data, Charset charset)
public static Request.Body create(byte[] data)
public static Request.Body create(byte[] data, Charset charset)
@Deprecated public static Request.Body encoded(byte[] data, Charset charset)
create(byte[], Charset)
data
- to be encoded.charset
- to encode the data with. if null, then data will be considered
binary and will not be encoded.public static Request.Body empty()
Copyright © 2012–2020 OpenFeign. All rights reserved.