0
votes

I have to read the payload.request but i'm always getting null response. I tried the read and write function in transform message to convert payload into json object but after that also i am getting null for #[payload.request] in mule. How can i fix this issue.

Note: I can't use byte array to object, object to json these components.

POST request:

        {
          "request": "yli9SeTDuMLlS0oe01+bQluUPTuvH0pgWBuDvhaCInQqnLgdGrgAisVA3uHcq4kp"
        }
1
Why you can't use the object to json transformer?aled

1 Answers

-1
votes

Probably the HTTP POST request is missing the Content-Type header, so DataWeave doesn't know how to parse them. Fix the request so it has a Content-Type: application/json header.

Alternatively you can fix the input type of the DataWeave transform with the <dw:input-payload> element:

<dw:transform-message doc:name="Transform Message">
  <dw:input-payload mimeType="application/json"/>
  <dw:set-payload><![CDATA[%dw 1.0
      ...