• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 697
  • Last Modified:

How to use HttpClient to send the request message?

How can I use HttpClient to send the below request message to

Request message
POST /login.asp HTTP/1.1
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20071220 BonEcho/
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 10


1 Solution
alfredng1Author Commented:
I have read your reference links before. They only provide methods info e.g. GET, POST... They didn't say how to set properties!

For example, if I use URLConnection, then I can set
urlConnection.setRequestProperty("Content-Type",  "application/x-www-form-urlencoded");

If you know how to do it, could you please show it to me?

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now