Q: HTTP/1.1 400 Bad Request when trying to make Get request with c++ win API sockets to localhost i have this simple code which send http get request using win32 API 
but i keep getting error: 
  HTTP/1.1 400 Bad Request
Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Pragma: no-cache
Expires: 0
Content-Type: text/plain; charset=utf-8
Date: Sat, 27 Aug 2016 13:44:25 GMT
Connection: close

Error 400: Bad Request
Bad Request

Here is my code : 
WSADATA wsaData;
    if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
        //std::cout << "WSAStartup failed.\n";
        //system("pause");
        //return 1;
    }
    SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    struct hostent *host;
    host = gethostbyname("localhost");
    SOCKADDR_IN SockAddr;
    SockAddr.sin_port = htons(8081);
    SockAddr.sin_family = AF_INET;
    SockAddr.sin_addr.s_addr = *((unsigned long*)host->h_addr);
    //std::cout << "Connecting...\n";
    if (connect(Socket, (SOCKADDR*)(&SockAddr), sizeof(SockAddr)) != 0){
        //std::cout << "Could not connect";
        //system("pause");
        //return 1;
    }
    std::string queryStr = "p_1=1&p_2=2&p_3=3"
    //std::cout << "Connected.\n";
    std::string queryStrToSend = "";
    queryStrToSend.append("GET /?");
    queryStrToSend.append(queryStr);
    queryStrToSend.append(" HTTP / 1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n");
    //"GET /?p_1=1&p_2=2&p_3=3 HTTP/1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n"
    //send(Socket, "GET /?p_1=1&p_2=2&p_3=3 HTTP/1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n", strlen("GET /?p_1=1&p_2=2&p_3=3 HTTP/1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n"), 0);
    send(Socket, queryStrToSend.c_str(), strlen(queryStrToSend.c_str()), 0);
    char buffer[10000];
    int nDataLength;
    while ((nDataLength = recv(Socket, buffer, 10000, 0)) > 0){
        int i = 0;
        while (buffer[i] >= 32 || buffer[i] == '\n' || buffer[i] == '\r') {
            std::cout << buffer[i];
            i += 1;
        }
    }
    closesocket(Socket);
    WSACleanup();

what can be wrong ?
if i uncommemd this line : 
send(Socket, "GET /?p_1=1&p_2=2&p_3=3 HTTP/1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n", strlen("GET /?p_1=1&p_2=2&p_3=3 HTTP/1.1\r\nHost: http//127.0.0.1\r\nConnection: close\r\n\r\n"), 0);

every thing is working great . 
