02-06-2013 06:45 AM
Actually I want to pass text data in the body of httpconnection.
I was trying with apache httpclient library in blackberry, have been integrated jar file in my project but getting compilation error while running my project.
Kindly tell me how to pass a body in HttpConnection using 'POST' method.
Below code i am using but getting null data in response:
byte  bodyBytes = getBodyBytesFromSomewhere(); OutputStream out = httpConnection.openOutputStream(); out.write(bodyBytes); out.flush(); out.close();
02-06-2013 05:54 PM
Remember that you can't used J2SE code in a J2ME application. I suspect that is why you are not able to use the Apache code.
With respect to why your post code is not working, there are a lot of possible reasons, too many so that all we would be doing is speculating. Please try out you code carefully and make sure you are setting the write connection method and that you are setting the correct headers, for example the header length, which you don't set is probably required. I recommend that you search the forum for the many many links on networking - it is not easy for BB. There is a lot to learn, Start by just typing network in the search box and look t the videos that you find...