I have made a method to make http request using LWUIT IO library and also tried with J2me library. Everything is working fine on simulator but when i tired on two different Nokia phones then i have received exception. Both are showing different exceptions. Exceptions-
- 411 length required
- java.io.IOException: Error in HTTP operation:Error in HTTP operation
Here is my code-
private void startReq(String url) {
NetworkManager.getInstance().start();
ConnectionRequest myRequest = new ConnectionRequest() {
protected void readResponse(InputStream input) throws IOException {
StringBuffer stringBuffer = new StringBuffer();
int ch;
while ((ch = input.read()) != -1) {
stringBuffer.append((char) ch);
}
System.out.println("Response:"+stringBuffer.toString());
}
};
progress = new Progress("Please Wait ", myRequest,true);
progress.setDisposeOnCompletion(true);
myRequest.setUrl(url);
myRequest.setPost(true);
NetworkManager.getInstance().addToQueue(myRequest);
progress.show();
}