0

Hi everyone I am new using WSO2 ESB, here is the issue I made a integration project to learn but I have not been able to read the body of my request when I try I see this warning "Json Payload is empty" enter image description here

Here is how I am trying to read the body <filter regex="[1-9]" source="json-eval($.test)">

enter image description here

And finally here is my request, I already set the header application/json

enter image description here

If anyone could help me, I would be very grateful. Thanks in advance

2 Answers2

0

The request needs to be a POST to see the payload hit the ESB. With GET it will just do a GET request without it.

Technically you can do GET with body but it's not a very common scenario.[1]

[1]https://docs.wso2.com/display/EI611/Unusual+Scenarios+for+HTTP+Methods+in+REST#UnusualScenariosforHTTPMethodsinREST-UsingGETwithaBody

Novren
  • 61
  • 6
0

That is because the GET method in wso2 does not allow the body payload. You can read in wso2 documentation:

Typically, a GET request does not contain a body, and the ESB profile does not support these types of requests. When it receives a GET request that contains a body, it drops the message body (...)

From doc: Using GET with a Body

Additional it is not good practice to do that, refer to this question: HTTP GET with request body

So you should use POST request.

tmoasz
  • 484
  • 4
  • 9