Hi, I am using link http://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpServer.java to create HTTP server in Android. However in my response I always get HTTP/1.1 200 OK in the body(though the header has the status code 404 in it). Please refer to the attached screenshot. Is it due to the DefaultResponseFactory() defined in the HttpService?
To set the response: HttpResponse getResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, 404, "Not Found"); String sb = "The requested resource " + target + " could not be found due to mismatch!!" ; getResponse.setStatusCode(HttpStatus.SC_NOT_FOUND); getResponse.setEntity(new StringEntity(sb.toString() + " Status Code:" +getResponse.getStatusLine() + " " ,"UTF-8")); -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
<<attachment: Poster_ScreenShot.PNG>>