Question about http request content

M

marcwentink

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
 
M

Mitja Trampus

[...]
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 :)
 
M

marcwentink

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.
 
M

marcwentink

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....
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top