in.html 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. <html><head><title>CGI Script input</title></head><body><h1><img alt="" src="in_files/CGIlogo.gif"> CGI Script Input</h1>
  2. <hr>
  3. <h2>Specification</h2>
  4. For requests which have information attached after the header, such as
  5. HTTP POST or PUT, the information will be sent to the script on stdin.
  6. <p>
  7. The server will send <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html#cl">CONTENT_LENGTH</a> bytes on
  8. this file descriptor. Remember that it will give the <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html#ct">CONTENT_TYPE</a> of the data as well. The server is
  9. in no way obligated to send end-of-file after the script reads
  10. <code>CONTENT_LENGTH</code> bytes. </p><p>
  11. </p><hr>
  12. <h2>Example</h2>
  13. Let's take a form with METHOD="POST" as an example. Let's say the form
  14. results are 7 bytes encoded, and look like <code>a=b&amp;b=c</code>.
  15. <p>
  16. In this case, the server will set CONTENT_LENGTH to 7 and CONTENT_TYPE
  17. to application/x-www-form-urlencoded. The first byte on the script's
  18. standard input will be "a", followed by the rest of the encoded string.</p><p>
  19. </p><hr>
  20. <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html"><img alt="[Back]" src="in_files/back.gif">Return to the
  21. interface specification</a> <p>
  22. CGI - Common Gateway Interface
  23. </p><address><a href="http://hoohoo.ncsa.uiuc.edu/cgi/mailtocgi.html">cgi@ncsa.uiuc.edu</a></address>
  24. </body></html>