Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Rebol Programming/read-cgi

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

USAGE: READ-CGI /limit size DESCRIPTION: Read CGI data from web server input stream. Return data as string. READ-CGI is a function value. REFINEMENTS /limit size -- Option to limit to this number of bytes (Type: any) SOURCE CODE read-cgi: func [ {Read CGI data from web server input stream. Return data as string.} /limit size "Option to limit to this number of bytes" /local data buffer ][ either system/options/cgi/request-method = "post" [ data: make string! 1020 buffer: make string! 16380 while [positive? read-io system/ports/input buffer 16380] [ append data buffer clear buffer if all [limit (length? data) > size] [ do make error! reform [ "read-cgi aborted - posting is too long:" length? data "limit:" size ] ] ] ] [data: system/options/cgi/query-string] any [data copy ""] ]