- java.lang.Object
-
- net.dongliu.cute.http.body.Bodies
-
public class Bodies extends Object
Utils method to create body
-
-
构造器概要
构造器 构造器 说明 Bodies()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static Body<List<Part>>multiPart(List<Part> parts)Create multi-part encoded request body, from several Parts.static Body<List<Part>>multiPart(Part... parts)Create multi-part encoded request body, from several Parts.static Body<byte[]>octetStream(byte[] value)Create octet-stream request body.static Body<Path>octetStream(Path path)Create octet-stream request body.static Body<InputSupplier>octetStream(InputSupplier inputSupplier)Create octet-stream request body.static Body<byte[]>of(byte[] value, MimeType mimeType)Create request body from byte array datastatic Body<byte[]>of(byte[] value, MimeType mimeType, Charset charset)Create request body from byte array datastatic Body<String>of(String value, MimeType mimeType)Create request body send string data using UTF-8 charset.static Body<String>of(String value, MimeType mimeType, Charset charset)Create request body send string datastatic Body<Path>of(Path path, MimeType mimeType)Create request body from filestatic Body<Path>of(Path path, MimeType mimeType, Charset charset)Create request body from filestatic Body<InputSupplier>of(InputSupplier supplier, MimeType mimeType)Create request body from input stream.static Body<InputSupplier>of(InputSupplier supplier, MimeType mimeType, Charset charset)Create request body from input stream.static Body<String>plainText(String value)Create request body sending plain text, with UTF-8 charset.static Body<String>plainText(String value, Charset charset)Create request body sending plain text.static Body<List<Param>>wwwForm(Collection<? extends Param> params)Create request body send x-www-form-encoded data, with UTF-8 charset.static Body<List<Param>>wwwForm(Collection<? extends Param> params, Charset charset)Create request body send x-www-form-encoded datastatic Body<List<Param>>wwwForm(Map<String,String> params)Create request body send x-www-form-encoded data, with UTF-8 charset.static Body<List<Param>>wwwForm(Map<String,String> map, Charset charset)Create request body send x-www-form-encoded datastatic Body<List<Param>>wwwForm(Param... params)Create request body send x-www-form-encoded data, with UTF-8 charset.
-
-
-
方法详细资料
-
plainText
public static Body<String> plainText(String value, Charset charset)
Create request body sending plain text.
-
octetStream
public static Body<byte[]> octetStream(byte[] value)
Create octet-stream request body.
-
octetStream
public static Body<InputSupplier> octetStream(InputSupplier inputSupplier)
Create octet-stream request body.
-
plainText
public static Body<String> plainText(String value)
Create request body sending plain text, with UTF-8 charset.
-
wwwForm
public static Body<List<Param>> wwwForm(Collection<? extends Param> params, Charset charset)
Create request body send x-www-form-encoded data
-
wwwForm
public static Body<List<Param>> wwwForm(Collection<? extends Param> params)
Create request body send x-www-form-encoded data, with UTF-8 charset.
-
wwwForm
public static Body<List<Param>> wwwForm(Map<String,String> map, Charset charset)
Create request body send x-www-form-encoded data
-
wwwForm
public static Body<List<Param>> wwwForm(Map<String,String> params)
Create request body send x-www-form-encoded data, with UTF-8 charset.
-
wwwForm
public static Body<List<Param>> wwwForm(Param... params)
Create request body send x-www-form-encoded data, with UTF-8 charset.
-
multiPart
public static Body<List<Part>> multiPart(List<Part> parts)
Create multi-part encoded request body, from several Parts.
-
multiPart
public static Body<List<Part>> multiPart(Part... parts)
Create multi-part encoded request body, from several Parts.
-
of
public static Body<byte[]> of(byte[] value, MimeType mimeType)
Create request body from byte array data- 参数:
mimeType- the mime-type of body
-
of
public static Body<byte[]> of(byte[] value, MimeType mimeType, Charset charset)
Create request body from byte array data- 参数:
mimeType- the mime-type of bodycharset- the charset encoding of body
-
of
public static Body<String> of(String value, MimeType mimeType)
Create request body send string data using UTF-8 charset.- 参数:
mimeType- the mime-type of body
-
of
public static Body<String> of(String value, MimeType mimeType, Charset charset)
Create request body send string data- 参数:
mimeType- the mime-type of bodycharset- the charset encoding of body
-
of
public static Body<InputSupplier> of(InputSupplier supplier, MimeType mimeType)
Create request body from input stream.- 参数:
mimeType- the mime-type of body
-
of
public static Body<InputSupplier> of(InputSupplier supplier, MimeType mimeType, Charset charset)
Create request body from input stream.- 参数:
mimeType- the mime-type of bodycharset- the charset encoding of body
-
of
public static Body<Path> of(Path path, MimeType mimeType)
Create request body from file- 参数:
mimeType- the mime-type of body
-
-