Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm getting a Get_Request undefined on this code. How would I correct this?
C++
int HTTP_GET();
sprintf(Get_Request, "GET %s HTTP/1.1\r\n");

sprintf(Get_Request, "%sHost: %s\r\n", Get_Request, HostURL);

sprintf(Get_Request, "%sUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3\r\n",Get_Request);

sprintf(Get_Request, "%sAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*//*;q=0.8\r\n",Get_Request);

sprintf(Get_Request, "%sAccept-Language: en-gb,en;q=0.5\r\n",Get_Request);

sprintf(Get_Request, "%sAccept-Encoding: gzip,deflate\r\n",Get_Request);

sprintf(Get_Request, "%sAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n",Get_Request);

sprintf(Get_Request, "%sKeep-Alive: 115\r\n",Get_Request);

sprintf(Get_Request, "%sConnection: keep-alive\r\n", Get_Request);
Posted

1 solution

Get_Request should be a char array variable which is not defined in your code.

Looks like your code come from this post[^].
On line 9 of the code in the post you will find the declaration of the Get_Request variable.
C++
int HTTP_GET()
{
WSADATA wsa;
struct hostent *remoteHost;
 
SOCKET sock;
struct sockaddr_in addr;
unsigned long win=0;
char Get_Request[523];//998576
char Response[8576]; //2018
int iResult;
DWORD dwError;

......
 
Share this answer
 
v3
Comments
Member 7766180 22-Sep-11 16:40pm    
Thank you so very much. Time for more coffee! :) I was wondering, since you nailed it on the head where the code came from, which headers would I use besides, winsock.h?

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