尝试通过REST发布到Google云端点时,我收到org.apache.http.client.HttpResponseException:错误请求
在我的Android应用上尝试使用http://loopj.com/android-async-http/时。我在POSTMAN REST客户端发了这篇文章没有错误。
以下是代码
AsyncHttpClient client = new AsyncHttpClient();
RequestParams p = new RequestParams();
p.put("test", "123");
client.addHeader("Content-Type", "application/json");
client.post("https://flash-energy-585.appspot.com/_ah/api/reminders/v1/reminders/createreminder",p, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
// Successfully got a response
System.out.println(response);
}
@Override
public void onFailure(Throwable error) {
System.out.println(error.toString());
}
});