我正在尝试使用Async loopj lib来获取Post表单数据,但是如何通过翻新2来获取相同的表单数据

时间:2018-07-14 06:01:57

标签: android

这是邮递员的请求

enter image description here

我可以使用以下请求获得响应,但是如何使用翻新2获得响应

    RequestParams params = new RequestParams();
    params.put("EI_USER", UserData.getId());
    params.put("EI_SIGN_IN", UserData.getSign_in_as());
    params.put("EI_DATA", "c_data");


    Asynch.post("orders?dashboard_status=" + dashboard_status + "&dashboard_category=" + dashboard_category + "&", params, new JsonHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
                Log.e("onSuccess: ", response.toString());
            }

            @Override
            public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
                Log.e("error ", throwable.toString());
                super.onFailure(statusCode, headers, responseString, throwable);
            }
        });

我已经尝试过这样的改造:

    @Headers({"Accept:application/json"})
    @FormUrlEncoded
    @POST("orders?dashboard_status=all&dashboard_category=orders")
    Call<JsonElement> getOrder(@Field("EI_USER") String UserID,
                                 @Field("EI_SIGN_IN") String SigninAs,
                                 @Field("EI_DATA") String EI_DATA);

邮递员控制台:

请求标头:

accept:"application/json"
content-type:"application/x-www-form-urlencoded"
cache-control:"no-cache"

请求正文:

EI_USER:"106"
EI_SIGN_IN:"buyer"
EI_DATA:"c_data"

0 个答案:

没有答案