Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Regular Contributor
Posts: 97
Registered: ‎04-19-2012
My Device: BB Torch-9800
My Carrier: *

Pass data in the body of HttpConnection using blackberry?

Hi Guys,

For Mobile app, we are using the back end salesforce service to get data, server had a service to receive data from the client in the body of the http request. Here to send data from the BlackBerry to the body of the http, we need to make use outputstream of the http connection as below code, whereas in android we can use of apache http client library to send data in the body of http using *setentity* method. i request you to provide me any library like apache http lib or any solution to achieve this either in client or in server.

byte [] bodyBytes = getBodyBytesFromSomewhere();
OutputStream out = httpConnection.openOutputStream();

Thanking you

Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Pass data in the body of HttpConnection using blackberry?

Hi @erAjayGoyal,


Check out this link:


and look for the POST example.


Also, I recommend you try and use the search box in the forum as this question was asked many times and there are several examples.


Hope that helps,