retrofit / retrofit2.http / Part

Part

@Target([AnnotationTarget.VALUE_PARAMETER]) class Part

Denotes a single part of a multi-part request.

The parameter type on which this annotation exists will be processed in one of three ways:

Values may be null which will omit them from the request body.


  @Multipart
  @POST("/")
  Call<ResponseBody> example(
      @Part("description") String description,
      @Part(value = "image", encoding = "8-bit") RequestBody image);
  

Part parameters may not be null.

Constructors

<init>

Part(value: String, encoding: String)

Denotes a single part of a multi-part request.

Properties

encoding

val encoding: String

The Content-Transfer-Encoding of this part.

value

val value: String

The name of the part. Required for all parameter types except .