Is it possible to send json to workflow through ajax post request? On the HTTP Server Input task I don’t see the MIME ‘application/json’ listed so I wondered if there was a work around.
Thanks
Is it possible to send json to workflow through ajax post request? On the HTTP Server Input task I don’t see the MIME ‘application/json’ listed so I wondered if there was a work around.
Thanks
What version of Workflow are you using?
The latest, 8.8.0 as the application/JSON in the MIME list.
running 8.6
Thanks i was afraid of that…
Upon looking further into this, I found out that there is an error in our documentation as the role of the MIME type in the HTTP Server Input.
The MIME type is referring to the type of the file that is returned by the HTTP Server Input at the very end of the process.
In your case, since you want to send data TO a Workflow process, you simply need to use JSON.stringnify in your code and add the JSON string to a variable that you will pass with your Ajax Post request.
I have informed our documentation department of the error and it will be corrected.
Sorry for the confusion it brought.
Ok, thanks for the information. I’m stumped then because I keep getting an error when attempting the send json with contentType: application/json to the workflow server. specifically a “OPTIONS MaskedserverAddress net::ERR_EMPTY_RESPONSE” error.
Maybe don’t send with content type ‘application/JSON’. Since you are sending a JSON string, treat it as a string.