Thread: Http Post

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    288

    Http Post

    im trying to figure out if its possible to send POST data through HTTP from a C program.. the reason is, i want to send data from my program to my site (where there is a perl/php script) that then processes this data and returns a reply string. thing is, i cant figure out how to actually send the POST data, i know how to send GET data, but im not sure about POST.

    i already searched google, and all i get is CGI scripting.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    Sep 2001
    Location
    Fiji
    Posts
    212
    CGI scripting is the place to look. It has been a couple of years since i have done any of this so i can't remember off the top of my head but that is a good place to start.

    If you understand the HTTP protocol and how to talk to a server then you should be able to code the required commands into your program.

    Hope this helps.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    ive been looking and looking and i cant find a decent explanation of the http protocol... i did find a few open source http servers/browsers that might help though. does anyone know where i can find a good http protocol explanation? namely the POST/GET part of it

  4. #4
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    You can't really beat RFCs for down and dirty protocol information:

    http://www.faqs.org/rfcs/rfc2616.html
    If you understand what you're doing, you're not learning anything.

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    http://www.google.com/search?q=POST+HTTP/1.0 (sample in first result)

    POST is the same as GET except that the word "GET" is replaced with the word "POST" and the post data follows the \r\n\r\n at the end of the headers.

  6. #6
    Registered User
    Join Date
    Mar 2005
    Posts
    76
    Are you using WinINet?
    (things like HttpOpenRequest etc)

  7. #7
    Registered User
    Join Date
    Apr 2005
    Posts
    134
    This link will give you an overview of HTTP protocol. Its a good tutorial for developers.

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    thanks everyone, i finally figured it out using a combination of all the links you gave me, and no, im not using WinINET

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 04-21-2009, 11:04 AM
  2. need help with HTTP POST
    By Anddos in forum Networking/Device Communication
    Replies: 5
    Last Post: 03-22-2009, 08:41 AM
  3. Post your Best Text Adventure
    By Joe100 in forum Game Programming
    Replies: 3
    Last Post: 08-15-2003, 05:47 PM
  4. Auto POST
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 06-07-2003, 10:42 AM