Problem using HTTP 1.1 request

Posted on 2006-04-16
Last Modified: 2010-03-18
I'm writing an application which requests web data using the C socket library.

There must be something wrong with my requests, because they only work when I use HTTP 1.0, but when I use 1.1 they either hang, or else return slightly corrupted results.

Here's a typical request header my program generates:

GET / HTTP/1.1
User-agent: MyApp 1.0;
Accept: text/html, text/xml, text/plain
Question by:chsalvia
    LVL 19

    Expert Comment

    chsalvia, I would better post my question in Linux Programming
    LVL 3

    Accepted Solution

    try to play with:
    Accept-Encoding and Accept headers in request
    for example Accept: text/plain
    and you'll get uncompressed output.

    LVL 3

    Assisted Solution

    Hello chsalvia,

    GET / HTTP/1.1

    Should be enough to get a correct answer from any server with HTTP 1.1, remove or play with the UserAgent.



    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 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

    24 Experts available now in Live!

    Get 1:1 Help Now