Click here to Skip to main content
15,917,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I need to make a program that access a website via C++ and show some content on the console.
With
VB
HEAD / HTTP/1.1
Host:

User-agent: Prova1
Connection: close
Posted

If you're running on Windows, you can use WinHttp - http://msdn.microsoft.com/en-us/library/windows/desktop/aa382925(v=vs.85).aspx[^]
 
Share this answer
 
first try what you are doing with telnet.

donwload putty and do the telnet with the same queries.

C++
HEAD / HTTP/1.1
Host:
 
User-agent: Prova1
Connection: close


but in this above sequence there is a small flaws your user-agent and connection wont reach to server the correct syntax would be
HEAD / HTTP/1.1
Host: host_name
User-agent: Prova1
Connection: close


another issue is if you send HEAD request server would be reply only with Header information. to get content you need to send GET request.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900