Is there any other variable that I should check to get the POST data?
When the REQUEST_METHOD
is HTTP_POST
, both CONTENT_LENGTH
and CONTENT_TYPE
will let you find the attributes of the POST
entity (same story with HTTP_PUT
).
The X_HTTP_HEADERS
value (added last year) makes it easier and faster to find the end of the HTTP headers (where the POST
entity resides) - but finding the end of the HTTP headers (a double CRLF
) can be done in a Ruby script by starting from the REQUEST_URI
or the QUERY_STRING
.
The /csp/hello.rb
G-WAN example shows how to list query parameters:
# list QUERY PARAMETERS, if any:
#
# GET http://10.10.200.80/?hello.rb&arg1=123&arg2=456
arg: arg1=123
arg: arg2=456
ARGV.each do|a|
puts "arg: #{a}<br>"
end