Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
02-24-2011 03:02 AM
I have a JSON object , which i have changed it into a String. Now i want to send that String over HTTP using POST method, because at the server side they can only accept JSON String as a response, so i need to only send JSON String, not other than that like BYTE array or something else
So, i want ur Help!!
02-24-2011 04:41 AM
The HttpConnection JavaDoc has an example of doing a POST. There are other examples on the forum too. Search for POST. The mechanism is not specific to JSON strings, though you might want to set an encoding method to indicate you are sending json, rather than URL Encoded data which is what most samples will send.
02-24-2011 07:45 AM
I wrote dis code:
reply=a.getSuppliers(); http.setRequestProperty("entity", reply); http.setRequestMethod(HttpConnection.POST); OutputStream httpOutput=http.openOutputStream(); byte data=reply.getBytes("UTF-8"); http.setRequestProperty("Content-Length", Integer.toString(data.length)); httpOutput.write(data); httpOutput.flush(); httpOutput.close();
As in dis code, if i amsending that byte array.. I am getting HTTP ERROR 415... since the server side code only accepting JSON String (somthing called JAXELEMENT).. So, how could i Encode an encodeing method for JSON String??
Plz guide me... Urgent!!
02-24-2011 08:52 AM
Your Server technical people shoud guide you on this.