-3

I know c++ windows socket and i can connect to HTTP server. *why at every command sent to the server i must use "/r/n" at the end?* I want to fill forms (boxes) in HTTP site. I heard u can do this with post request, how to do that in c++ using windows sockets? What command should i send? What is get? post? I don't want to do that in lib curl and things like that. What command i need to send? Should i send it in one time or using send function multiply times?

Cœur
  • 37,241
  • 25
  • 195
  • 267
John Smith
  • 13
  • 1

1 Answers1

1

The HTTP 1.1 protocol is defined in RFC 2616. This document describes things like why lines end with "\r\n" (see section 2.2, but it basically say "because we had to make a decision, so we decided on \r\n"). Section 5 talks about requests, which is where things like POST are discussed and contains pointers to individual sections about each verb.

If you want a higher level HTTP API that is still part of Windows, you could use WinInet.

To implement things like submitting a form, you probably want to also look at the various HTML specs' topics on form submission. The HTML 4.0.1 spec talks about this in section 17.13 These specs will tell you how to craft the HTTP requests that you will need to make against the server.

Implementing automated form submission via sockets alone is a large undertaking. :-)

chwarr
  • 6,777
  • 1
  • 30
  • 57
  • HELP ME I READ A FEW API AND CAN UNDERSTAND THEM. BUT THERE ARE SOME API THAT I DONT UNDERSTAND THEIR BEHAVIOUr and the parameters passed to the functions what can i do? can someone tell me what to do so i understand api functions better and how to become better ? u have tutorial? what should i know before api and msdn site?? – John Smith Nov 11 '13 at 12:55