I am writing a client program, simply retreving the HTML code.
However, I only get a error 400
I really don't know what the bug is...
here is the part of sending code
No matter what I type, the received message is always error 400Code:char cBuffer[128], cTmp[128]; const int iBufferLen = strlen(cBuffer); while(1){ printf("\nsend>"); gets(cTmp); if(cTmp == "") { printf("Bye Bye..."); break; exit(1); } printf("Sending...\t\t\t"); sprintf(cBuffer, "GET /%s HTTP/1.0\n", cTmp); if(send(s, cBuffer, iBufferLen, 0) == SOCKET_ERROR) { printf("Failed\n"); } printf("OK\n\"%s\" is sent\n", cBuffer); ....
why ?



LinkBack URL
About LinkBacks


