use of retrofit2.http.Field in project retrofit by square.
the class RequestBuilderTest method formEncodedWithEncodedNameFieldParam.
@Test
public void formEncodedWithEncodedNameFieldParam() {
class Example {
//
@FormUrlEncoded
//
@POST("/foo")
Call<ResponseBody> method(@Field(value = "na%20me", encoded = true) String foo) {
return null;
}
}
Request request = buildRequest(Example.class, "ba%20r");
assertBody(request.body(), "na%20me=ba%20r");
}
Aggregations