我正在使用翻新并出现此错误,为什么我得到此错误?是响应还是请求的问题? 我得到的响应是简单的json {“错误”:“已在请求中”}
public static Retrofit getRetrofitInstance2(final String token){
if (retrofit == null) {
Gson gson = new GsonBuilder()
.setLenient()
.create();
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request newRequest = chain.request().newBuilder()
.addHeader("Authorization", "Bearer " + token)
.header("Content-Type","application/json")
.build();
return chain.proceed(newRequest);
}
})
.build();
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
}
return retrofit;
}
@SerializedName("message")
String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@FormUrlEncoded
@POST("user/send/request")
Call<BookingResponse> getServiceBooked(@Field("s_latitude") String latitude, @Field("s_longitude") String longitude,
@Field("service_type") String serviceType, @Field("payment_mode") String payment,
@Field("schedule_date") String date, @Field("schedule_time") String scheduleTime,
@Field("s_address") String address, @FieldMap HashMap<String, String> questions,
@Field("question[]") String[] mainList);