Пытаемся получить содержание данные post с помощью cgi. Делаем:
# curl -d "t" http://127.0.0.1:333/cgi-bin/test.cgi
получаем:
export CONTENT_LENGTH='4'
export CONTENT_TYPE='application/x-www-form-urlencoded'
export GATEWAY_INTERFACE='CGI/1.1'
export HOME='/root'
export HTTP_ACCEPT='*/*'
export HTTP_HOST='127.0.0.1:333'
export HTTP_USER_AGENT='curl/7.38.0'
export LANG='ru_RU.UTF-8'
export LOGNAME='root'
export MAIL='/var/mail/root'
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
export PATH_INFO=''
export PWD='/srv/cgi-bin'
export QUERY_STRING=''
export REMOTE_ADDR='127.0.0.1'
export REMOTE_PORT='47943'
export REQUEST_METHOD='POST'
export REQUEST_URI='/cgi-bin/test.cgi'
export SCRIPT_FILENAME='/srv/cgi-bin/test.cgi'
export SCRIPT_NAME='/cgi-bin/test.cgi'
export SERVER_PROTOCOL='HTTP/1.0'
export SERVER_SOFTWARE='busybox httpd/1.22.1'
export SHELL='/bin/bash'
export SHLVL='2'
export SSH_CLIENT='10.99.100.10 1173 22'
export SSH_CONNECTION='10.99.100.10 1173 10.99.215.7 22'
export SSH_TTY='/dev/pts/0'
export TERM='xterm'
export USER='root'
export _='/bin/busybox'
root@srv:/#
Как получить параметры, переданные методом post?