use of retrofit2.http.QueryName in project retrofit by square.
the class RequestBuilderTest method queryNameParamOptionalOmitsQuery.
@Test
public void queryNameParamOptionalOmitsQuery() {
class Example {
//
@GET("/foo/bar/")
Call<ResponseBody> method(@QueryName String ping) {
return null;
}
}
Request request = buildRequest(Example.class, new Object[] { null });
assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/");
}
Aggregations