0
votes
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"   contentType="application/x-www-form-urlencoded" path="getDetails" />
<object-to-string-transformer doc:name="Object to String"/>
<logger message=" Logging ...... #[message:payload]" level="INFO" doc:name="Logger"/>

i invoke thru chrome rest client

http://localhost:8081/getDetails

METHOD : post

below is json data

{ "id": "1", "firstName": "xyz", "lastName": "abc", "address":"xy"

}

whatever json data i passed , i just want to print for processing . but In logging it shows null payload

any suggesstion are welcome

3

3 Answers

0
votes

I tested your scenario with the following :-

 <flow name="Flow1" doc:name="Flow1">
      <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"   contentType="application/x-www-form-urlencoded" path="getDetails" />
        <object-to-string-transformer doc:name="Object to String"/>
        <logger message=" Logging ...... #[message:payload]" level="INFO" doc:name="Logger"/>
    </flow> 

And I got it in the log as bellow :- enter image description here

0
votes

You have probably posted in the same question in another thread too. Please read comments in mule post json data to mule endpoint url

0
votes

After http:inBound you need to convert it to json using object to string transformer