Hi everyone,
I’m currently working with webMethods API Gateway and running into an issue with accessing data from a application/x-www-form-urlencoded
request.
Here’s the setup:
- Request Type: POST
- Content-Type:
application/x-www-form-urlencoded
- Request Example:
POST /submitSMT HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: abc123
jobId=1234&status=complete&priority=high
- Goal: I need to extract the form data parameters (
jobId
,status
, andpriority
) from the request body.
What I’ve Tried So Far:
In my API Gateway policy, I’ve tried using the following expressions to access the form data:
token=${request.headers.Authorization}
jobId=${request.body.get('jobId')}
status=${request.body.get('status')}
priority=${request.body.get('priority')}
However, the response I get looks like this:
token=abc123
jobId=${request.body.get('jobId')}
status=${request.body.get('status')}
priority=${request.body.get('priority')}
It seems like the form data isn’t being parsed or accessed properly.
I also tried accessing the data via request.payload
but didn’t have any success there either.
Questions:
- How should I correctly access form data from the request body in webMethods API Gateway?
- Are there any specific methods or syntax for handling
application/x-www-form-urlencoded
data?
Any help or guidance would be greatly appreciated!
Thanks in advance!