开发者

Android : HTTP Post Issue

开发者 https://www.devze.com 2022-12-28 17:07 出处:网络
HttpClient client = new DefaultHttpClient(); String data = \"valid SOAP REquest\"; HttpPost httpPost = new HttpPost(\"valid url\");
    HttpClient client = new DefaultHttpClient();
    String data = "valid SOAP REquest";     

HttpPost httpPost = new HttpPost("valid url"); Log.d("inside", "created http post")开发者_运维问答; try { ByteArrayInputStream baos = new ByteArrayInputStream(data.getBytes());

        Log.d("inside", "firing request...");
        HttpResponse httpResponse = client.execute(httpPost);
        Log.d("inside", "request sent" + httpResponse.getStatusLine().getStatusCode());

Always, I get the status code as 405. I tried request queue as well.. sneding the byte array as part of the request queue, still the same issue.


Who is hosting your server-side request ?
A 405 is typically because a srvice provider will not allow a POST.
Look here for what 405 is. and a couple of solutions.

0

精彩评论

暂无评论...
验证码 换一张
取 消