Mr. Sajid Shaikh
Mr. Sajid Shaikh

Reputation: 7261

In J2ME, How to set Header information with HttpConnection?

I have used HttpConnection in J2ME for communication between server. I want to send some data to server with http header. Can anybody tel me how to set header information with HttpConnection. Any example. Thanks

Upvotes: 0

Views: 764

Answers (1)

Vicente Plata
Vicente Plata

Reputation: 3380

From http://www.j2mesalsa.com/elearning/networking.html :

Set Header Information

To set request header properties use setRequestProperty(String key, String value).

Example:

setRequestProperty( "User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0" )

Hope it helps.

Upvotes: 5

Related Questions