http - help

Discussion in 'C++' started by anthony, May 16, 2006.

  1. anthony

    anthony Guest

    I am trying to use get http: to access a web site and parse the html
    returned.

    I open a socket and send a request across of the form
    GET address http/1.0 where address is the specifics i am trying to log
    onto.

    the code works with web sites such as
    "http://www.statistics.gov.uk/instantfigures.asp"
    The http protocol header is removed.
    The connection onto the socket is made on "www.statistics.gov.uk"
    and the get is done on hthe address GET "/instantfigures.asp" http/1.0.

    This is successful and the html is successfuly returned.

    However, when i try to do exactly the same with the following web site.
    "http://epp.eurostat.cec.eu.int/portal/page?_pageid=1996,39140985&_dad=portal&_schema=PORTAL&screen=detailref&language=en&product=EUROIND&root=EUROIND/shorties/euro_cp/cp240"
    I get returned "ERROR 400 - Bad Request - your browser sent a message
    the server could not understand"

    I use exactly the same method to perform the call.
    remove the http:
    connect to the socket on "epp.eurostat.cec.eu.int"
    and perform my http on
    "/portal/page?_pageid=1996,39140985&_dad=portal&_schema=PORTAL&screen=detailref&language=en&product=EUROIND&root=EUROIND/shorties/euro_cp/cp240"

    I assume all the ? and , are some sort of parameter list, and i can
    find no documentation to help me understand this.
    If anyone could help me or know when to find the relevant information
    from i would be most grateful
    cheers
    Anthony
     
    anthony, May 16, 2006
    #1
    1. Advertising

  2. anthony wrote:
    > [...]
    > I use exactly the same method to perform the call.
    > remove the http:
    > connect to the socket on "epp.eurostat.cec.eu.int"
    > and perform my http on
    > "/portal/page?_pageid=1996,39140985&_dad=portal&_schema=PORTAL&screen=detailref&language=en&product=EUROIND&root=EUROIND/shorties/euro_cp/cp240"
    >
    > I assume all the ? and , are some sort of parameter list, and i can
    > find no documentation to help me understand this.


    Please post to 'comp.infosystems.www.authoring.cgi'. Your question has
    nothing to do with C++ language and as such is off-topic here.

    V
    --
    Please remove capital As from my address when replying by mail
     
    Victor Bazarov, May 16, 2006
    #2
    1. Advertising

  3. anthony

    Rolf Magnus Guest

    Victor Bazarov wrote:

    > anthony wrote:
    >> [...]
    >> I use exactly the same method to perform the call.
    >> remove the http:
    >> connect to the socket on "epp.eurostat.cec.eu.int"
    >> and perform my http on
    >> "/portal/page?_pageid=1996,39140985&_dad=portal&_schema=PORTAL&screen=detailref&language=en&product=EUROIND&root=EUROIND/shorties/euro_cp/cp240"
    >>
    >> I assume all the ? and , are some sort of parameter list, and i can
    >> find no documentation to help me understand this.

    >
    > Please post to 'comp.infosystems.www.authoring.cgi'.


    I don't know that newsgroup, but it sounds like the wrong one, too. This has
    nothing to do with CGI. It's about the http protocol. One probably good
    source of information about that protocol might be the RFC that defines it.
    To the OP: See http://www.faqs.org/rfcs/rfc2616.html
     
    Rolf Magnus, May 16, 2006
    #3
  4. anthony

    asterisc Guest

    >I am trying to use get http: to access a web site and parse the html
    >returned.


    There are a specific WinAPI set of functions that will make your job
    easier: WINHTTP

    Client: Requires Windows XP SP1 or Windows 2000 Professional SP3.
    Server: Requires Windows Server 2003 or Windows 2000 Server SP3 and
    later.
    Header: Declared in Winhttp.h.
    Library: Use Winhttp.lib.
    DLL: winhttp.dll

    Search the MSDN collection or google :)
     
    asterisc, May 16, 2006
    #4
  5. anthony

    Ian Collins Guest

    anthony wrote:
    > I am trying to use get http: to access a web site and parse the html
    > returned.
    >
    > I open a socket and send a request across of the form
    > GET address http/1.0 where address is the specifics i am trying to log
    > onto.
    >
    > the code works with web sites such as
    > "http://www.statistics.gov.uk/instantfigures.asp"
    > The http protocol header is removed.
    > The connection onto the socket is made on "www.statistics.gov.uk"
    > and the get is done on hthe address GET "/instantfigures.asp" http/1.0.
    >
    > This is successful and the html is successfuly returned.
    >
    > However, when i try to do exactly the same with the following web site.
    > "http://epp.eurostat.cec.eu.int/portal/page?_pageid=1996,39140985&_dad=portal&_schema=PORTAL&screen=detailref&language=en&product=EUROIND&root=EUROIND/shorties/euro_cp/cp240"
    > I get returned "ERROR 400 - Bad Request - your browser sent a message
    > the server could not understand"
    >

    Did you do what I suggested last time you asked?

    --
    Ian Collins.
     
    Ian Collins, May 17, 2006
    #5
  6. anthony

    Rolf Magnus Guest

    asterisc wrote:

    >>I am trying to use get http: to access a web site and parse the html
    >>returned.


    Please be more careful with quoting. I wasn't the one who wrote that.

    > There are a specific WinAPI set of functions that will make your job
    > easier: WINHTTP


    They will only if the OP is using Windows. Otherwise, they will be
    completely useless to him.
     
    Rolf Magnus, May 17, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiong Feng
    Replies:
    0
    Views:
    931
    Jiong Feng
    Nov 19, 2003
  2. Paul Glavich [MVP - ASP.NET]
    Replies:
    0
    Views:
    471
    Paul Glavich [MVP - ASP.NET]
    Jun 20, 2004
  3. T. Regan
    Replies:
    3
    Views:
    755
    T. Regan
    Jun 21, 2004
  4. NNTP
    Replies:
    2
    Views:
    1,015
    =?Utf-8?B?S2V2aW4gVG9kZA==?=
    Mar 18, 2005
  5. Fred
    Replies:
    17
    Views:
    274
Loading...

Share This Page