Creating a mock rest API which receives data via x-www-form-urlencoded

Hello,

I am trying to create a mock API which should receive specific parameters via x-www-form-urlencoded and return the output as application/json. For this, I created a rest resource which calls a service having inputs matching the inputs passed in Body - x-www-form-urlencoded in Postman. Http method is GET. However, when I send the request using Postman I can’t see anything in the pipeline.
According to the documentation (https://documentation.softwareag.com/webmethods/integration_server/pie10-15/webhelp/pie-webhelp/index.html#page/pie-webhelp%2Fto-content_handlers_5.html%23) is says that when content type is application
/x-www-form-urlencoded then the content handler decodes an incoming input stream and converts the content to key/value pairs. If the key already exists, the value is added to a list in the pipeline with the key key+list.
For returning the output as application/json I managed to do this using setResponse service but I just can’t get the inputs from Postman. Do you have any idea how I can achieve this?

Thanks,
n23

Hi @niemand23,

Can you please specify which version of Integration Server you are using? Also, have you applied the latest fixes? If not, what’s the fix version you are on? Have you see any errors in the server log of Integration Server? Is this licensed version or trial version?

Thanks,
Sree

Hi,

I am using Integration Server version 10.7 (IS_10.7_Core_Fix3). Is is the licensed version. Do you think it might be fix level related?
What should be the expected behavior in this case?

n23

Hello @niemand23 ,
Can you please provide more details about the scenario? What are some sample inputs you are passing in Postman, what is the HTTP method in Postman? some screen shots will help as well.
You can try adding a pub.flow:tracePipeline call in the flow service as the first step to confirm the data that is reaching the flow service.

-NP

for GET method, the request-body has no semantic meaning. Try use other methods POST or PUT.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.