I am building a web server using Apache and Perl CGI which processes the POST requests sent to it. The processing part requires me to get the completely unprocessed data from the request and verify its signature.
The client sends two different kinds of POST requests: one with the content-type set as application/json
, and the second one with content type as application/x-www-form-urlencoded
.
I was able to fetch the application/json
data using cgi->param('POSTDATA')
. But if I do the same for application/x-www-form-urlencoded
data, i.e. cgi->param('payload')
, I get the data but it's already decoded. I want the data in its original URL-encoded format. i.e I want the unprocessed data as it is sent out by the client.
I am doing this for verifying requests sent out by Slack.