• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Post Vs. Get

I'm writing a cgi script and posts and gets to other cgi scripts.
I know the GET command does something like this:
blah.cgi?string=value&string=value <--and so on
How does a POST work? I'm trying to manually type it in the same way and it doesn't work.. please help me.
0
chiefarcher
Asked:
chiefarcher
  • 2
  • 2
1 Solution
 
pc012197Commented:
With POST, the argument string is piped to the standard input of the CGI script. The format of the argument string is the same as in the GET command.
The command-line equivalent of a CGI call with POST is

echo "string=value&string=value..."|blah.cgi

0
 
chiefarcherAuthor Commented:
But How would I be able to post it to the browser...
would I do a
http://whatever.com?"string=value&string=value"|blah.cgi
or how would I type this?
0
 
pc012197Commented:
You can't simply write it into the URL. Some servers support this (they don't really care if a request is GET or POST - they simply use both mechanisms to transfer data to the CGI script. Therefore, *sometimes* it works with a simple
http://whatever.com/blah.cgi?string=value
Ususally it doesn't, though.)

So if you want to call a CGI script with arguments you have to use a FORM with METHOD=POST.

0
 
chiefarcherAuthor Commented:
thanks pc... for my company, I'm releasing a "submit-it" type program.. The cool thing is the user only has to hit the "Submit" button one time.  The only thing I'm having problems with is server's that have "post" set up rather than "get"

thanks..
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now