给建立在新浪云上的后端服务器发送okhttp post 请求500 Internal server error

7 views
Skip to first unread message

Guanghui Zhang

unread,
Mar 15, 2016, 11:42:05 AM3/15/16
to sae-python

各位技术大牛:


给建立在新浪云上的后端服务器发送okhttp post 请求,代码大概如下:


ServiceApi api = ServiceGenerator.createService(ServiceApi.class, user, password);


Call<MyResponse> call = api.postData(myData);


call.enqueue(new Callback<MyResponse>() {

    @Override

    public void onResponse(Call<MyResponse> call, Response<MyResponse> response) {

        int result = response.code();

        Log.i(MainActivity.TAG, "status code: " + result);

        MyResponse myResponse = response.body();


        }


        @Override

        public void onFailure(Call<MyResponse> call, Throwable t) {


        }

    });


但是status code得到的500 Internal server error, 但是同样的请求通过浏览器,terminal发送时完全正常。那里错了?

Reply all
Reply to author
Forward
0 new messages