0

Postman sending body parameters

This is my Postman call (rest post) to a Rest Endpoint with Body parameters in x-www-form-urlencoded.

How can I do that in Snaplogic with REST POST snap? I didn't find how to declare the body parameters (only header and query parameters).

mdaniel
  • 31,240
  • 5
  • 55
  • 58
Robert
  • 1
  • 1
  • 2

1 Answers1

1

Following are the steps for passing body parameters as x-www-form-urlencoded in SnapLogic's REST POST snap.

For this test, I created the following test pipeline.

Pipeline

I set the parameters to send in a mapper.

Data

Then I create the content (in another mapper) to pass into the body as follows.

Create Content

Following is the expanded expression.

Expression

Then, in the REST POST snap, you need to pass this content in the HTTP entity.

content as http entity

Also, in the REST POST snap, set the content type.

content type

Following is the screenshot for successful validation.

success

So, the idea is to pass the parameters as key-value pairs separated by & in the HTTP entity field of REST POST snap. Both the key and the value needs to be URI encoded. Also, the Content-Type in the headers section needs to be application/x-www-form-urlencoded. And, that should be it.

The required result will be the $response.entity object in the output of your REST POST snap.

Hope this helps :)

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58