UPDATE - the default type for $.post is xml-encoded so I went the 'fetch' route instead since it allows easier control over config settings
--------------------------------------------
I'm also trying to call the V2 API service/show endpoint but instead using Javascript from a browser.
A "400 (BAD REQUEST)" is returned which I think is caused by the wrong data type being sent with the POST - thought it was sending JSON but maybe not. I've tried several different ways of sending the data (2nd parameter in the post) but get 400 every time.
Before making the call I used "http://localhost:4316/api/v2/service/items" to get a list of service items and grabbed the ID from the list.
Here's the code snippet for reference:
------------------------------
$.post("http://localhost:4316/api/v2/service/show",
{"id":"dc57e88c-2f0c-11ee-afd1-4c034fc3af90"},
function(result) {console.log("POST successful: " + result);}
);
-----------------------------
Any help with Javascript syntax is appreciated!
Paul