Retrofit 1.0
public interface IUrlService {
@POST("/login")
void userLogin(
@Body TypedString string,
Callback<ResultBean> callback);
}
service.userLogin(
new TypedString(JSON.toJSONString(paramBean)),
this);
Retrofit 2.0
@POST("exec")
Observable<HttpResult> Login(@Body RequestBody body);
//jsonStr是参数Bean的json字符串
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),jsonStr);
loginApiService.Login(body)