0

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

Mr. Sajid Shaikh
  • 7,051
  • 4
  • 21
  • 35

1 Answers1

5

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.

Vicente Plata
  • 3,370
  • 1
  • 19
  • 26