Receive JSON http response when invoking webMethods flow

Hi there,

Is it possible to receive a http response in form of JSON when invoking a webMethods flow?
When performing an invoke I always get a http response in form of html. I would like to receive a plain JSON as response.
Thank you and best regards

in your service, call: pub.flow:setResponse
and set:
response with your json string
contentType with application/json

1 Like

Works great! Thank you :slight_smile:

Do you invoke the service via http? I.e. using the …/invoke/service.path URL? Then just set the Accept header of the request to the desired mime type, and the server will return the data in the desired format. I think, HTML, XML and JSON are supported (at least).

This is a better way IMO since you don’t need to modify the service and the client decides which format should be delivered.

2 Likes