ServiceNow Unable to Process the Request Body with a Content-Type 'application/x-www-form-urlencoded' while using Scripted REST Web Service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 03:15 AM
Hello All,
Scenario:
We trying to connect with a third party application where they can consume our API and send us the request to be processed and update the incident record.
Issue:
The Content-Type of the request body is 'application/x-www-form-urlencoded' and ServiceNow is unable to process the request.
- Based on the link, we can override the 'Content-Type' to application/x-www-form-urlencoded
- But, we aren't able to receive the body using 'datastream'. We have used this same script by referring the link
- When we print the body, it shows 'com.glide.communications.GlideScriptableInputStream' in the logs
Kindly let me know if anyone has worked on processing the request body with the Content-Type as 'application/x-www-form-urlencoded'.
Thanks in advance.
Regards,
Surendar M
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 01:40 PM
As of London release, Servicenow claims that content type application/x-www-form-urlencoded is now fully supported in Scripted REST API. I have not tested it, but below I included the link from Release notes where it claims that request.queryParams behavior has been enhanced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2019 07:32 PM
Still a no-go (as of Madrid) if you're trying to compute the hash signature for incoming Slash commands. You'll still need to use a processor for an endpoint to get the right signature.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2019 02:51 PM
Confirmed... In Madrid I too am unable to get GlideTextReader() and readLine() to work at all with request.body.dataStream with an 'application/x-www-form-urlencoded' POST from Slack.
Looks like I'm facing re-architecting to a Processor.