我这样请求的数据正确吗?
@Override
public void getdata() {
new Thread(new Runnable() {
@Override
public void run() {
OkHttpClient okHttpClient = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder().url("https://www.sunofbeach.net/shop/api/onSell/page").get().build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
LogUtil.d(TAG,"失败"+e.getLocalizedMessage());
}
@Override
public void onResponse(Call call, Response response) throws IOException {
LogUtil.d(TAG,"成功"+response.body().string());
}
});
}
}).start();
02-09 12:00:17.734 5115-5158/com.example.tblianmeng D/[LogUtil]PreferentialPresenter: 成功{"timestamp":"2020-02-09T04:00:09.679+0000","status":400,"error":"Bad Request","message":"Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: \"page\"","path":"/shop/api/onSell/page"}
这个是log返回的数据。
您的每一个用心回答,都会让这个世界变得更美好一些!