LigHTTPd $POST_DATA like $QUERY_STRING for Bash
Added by Anonymous about 12 years ago
It'd be cool to support a variable pushed to Bash CGI (without perl/php etc) called $POST_DATA representing all the POST DATA in a request.
Replies (3)
RE: LigHTTPd $POST_DATA like $QUERY_STRING for Bash - Added by stbuehler about 12 years ago
just read it from stdin.
RE: LigHTTPd $POST_DATA like $QUERY_STRING for Bash - Added by Anonymous about 12 years ago
Can't seem to, not sure how either. I've tried cat $1, catting /dev/stdin (missing) but it just blegh, doesn't work.
RE: LigHTTPd $POST_DATA like $QUERY_STRING for Bash - Added by Anonymous about 12 years ago
I got it working with the following:
if [ "${REQUEST_METHOD}" = "POST" ] && [ ! -z "${CONTENT_LENGTH}" ]; then
read -n ${CONTENT_LENGTH} POST_DATA
fi