How to use HttpClient to send the request message?

Posted on 2008-11-10
Last Modified: 2013-11-23
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


Question by:alfredng1
    LVL 5

    Expert Comment


    Accepted Solution

    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

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now