You need to sign in to do that
Don't have an account?
Aphinya Phansawang
How to get POST request raw body in Visualforce Page
Hi All,
I'm developing webhook integration with Salesfroce using site.com work around.
I redirect webhook requst url to salesforce site and use controller to get POST parameters.
I use command below to get POST parameters.
I can get only file name and file type, cannot get file content.
Below is results of the code above.
Have any one have a work around to get the raw body of POST request or get the file content that send via POST request.
Thank you,
Aphinya
I'm developing webhook integration with Salesfroce using site.com work around.
I redirect webhook requst url to salesforce site and use controller to get POST parameters.
I use command below to get POST parameters.
MAP<string, string> params = ApexPages.currentPage().getParameters(); for (string paramname : params.keySet() ) body += paramname + '=' + params.get(paramname) + '\n'; if (body.endsWith('=\n')) { body = body.substring(0,body.length()-2); }The command above working find for normal string value but I have problem when try to get data of pdf file that send as binary data.
I can get only file name and file type, cannot get file content.
Below is results of the code above.
nullAppID=123 AppReference=JaneDoe file=/var/www/examples/post/123.pdf file.org.eclipse.jetty.servlet.contentType=application/octet-stream
Have any one have a work around to get the raw body of POST request or get the file content that send via POST request.
Thank you,
Aphinya