Tag: retrofit2

改造得到400不好的请求,但与邮递员合作

我的api基地的url是: https://locodealapi.herokuapp.com/api/deals 在邮递员通过后面的标题,它工作正常。 x-access-token:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ.5XFJnJqTsfID9uqOwkNf46oraj9jDxic7qNSqBdunD0 在改造接口我有以下但得到400坏请求 @POST("api/deals") Call<ResponseBody> deals(@Header("x-access-token") String x_access_token) 调用代码: Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://locodealapi.herokuapp.com") .addConverterFactory(GsonConverterFactory.create()) .client(httpClient.build()) .build(); AppRestAPI client = retrofit.create(AppRestAPI.class); Call<ResponseBody> call1 = client.deals( token ); call1.enqueue(new Callback<ResponseBody>() { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { Log.i(TAG, "The response is " + response.message()); Log.i(TAG, "The response is " + response.body()); […]