http - help

A

anthony

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/port...t=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
 
V

Victor Bazarov

anthony said:
[...]
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
 
R

Rolf Magnus

Victor said:
anthony said:
[...]
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
 
A

asterisc

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 :)
 
I

Ian Collins

anthony said:
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/port...t=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?
 
R

Rolf Magnus

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top