Question about http request content

Discussion in 'HTML' started by marcwentink@hotmail.com, Dec 22, 2005.

  1. Guest

    Dear People,

    I do not know if alt.html is really the good groep for asking something
    about http, but here is my question:

    How can I send information from the browser to a simple socket
    listener?

    I am writing a program that listens on port 3456 and receives a http
    request. In my browser I call http://localhost:3456/test.

    In my C++ program, that listens on port 3456, I receive this request
    in:

    nRet = recv(new_socket, szBuf, BUF_SZ, 0);

    Then in szBuf I can see a lot of things and information about the call,
    but not the "test" string.

    This is the information I get in szBuf:

    ---------------------------
    PROG_NAME
    ---------------------------
    GET /test HTTP/1.1

    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/vnd.ms-powerpoint, application/vnd.ms-excel,
    application/msword, application/x-shockwave-flash, */*

    Accept-Language: nl

    Accept-Encoding: gzip, deflate

    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
    1.1.4322)

    Host: localhost:3456

    Connection: Keep-Alive

    ---------------------------
    OK
    ---------------------------

    How can I send information from the browser to this socket listener,
    which is not a full webserver, just window socket in a CPP program??
    Where is the string "test" gone?
     
    , Dec 22, 2005
    #1
    1. Advertising

  2. wrote:
    > [...]
    > I am writing a program that listens on port 3456 and receives a http
    > request. In my browser I call http://localhost:3456/test.
    >
    > In my C++ program, that listens on port 3456, I receive this request
    > in:
    > nRet = recv(new_socket, szBuf, BUF_SZ, 0);
    >
    > This is the information I get in szBuf:
    >
    > ---------------------------
    > PROG_NAME
    > ---------------------------
    > GET /test HTTP/1.1 <=======
    > [...]
    >
    > Where is the string "test" gone?


    Look harder :)
     
    Mitja Trampus, Dec 22, 2005
    #2
    1. Advertising

  3. Guest

    Mitja:

    > Look harder :)


    Ai, ai, ai, you are right, I am blind :(

    You mean it's after the GET, right?

    GET /test

    Thanks a lot! I really did /*not*/ see it, overlooked the message.
     
    , Dec 22, 2005
    #3
  4. Guest

    Mitja:

    > Look harder :)


    Yeah, will I must say, now I see it too, and actually I feel a little
    small, hiding between my console and my mouse, the screen is getting
    bigger and bigger, and the letters "GET /test" look as big as those
    letters in Los Angelos where they make those movies....

    Yes I found it....
     
    , Dec 22, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2V2aW4gQnVydG9u?=

    Pre-Send Request Headers, Pre-Send Request Content

    =?Utf-8?B?S2V2aW4gQnVydG9u?=, Dec 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,130
    =?Utf-8?B?S2V2aW4gQnVydG9u?=
    Dec 31, 2004
  2. TheKeith
    Replies:
    20
    Views:
    107,196
    Chris Morris
    Oct 29, 2003
  3. hazz
    Replies:
    6
    Views:
    50,052
    SkyUCHC
    Jun 9, 2010
  4. Johannes Kleese
    Replies:
    4
    Views:
    287
    Terry Reedy
    Nov 27, 2012
  5. Cameron Simpson
    Replies:
    0
    Views:
    192
    Cameron Simpson
    Nov 12, 2012
Loading...

Share This Page