(I have also opened a support ticket about this, but hoping the community might have insight.) I am trying to make a POST call to another web site. (I have done this successfully from another web-based platform that permits ad hoc js to be added to pages, like Knack.)
However, the POST call appears to be converted to a GET by Knack and the call, understandably, fails. To make sure this was not accidental, I tried another POST with a web service that is set up to test REST calls and the same thing happened:
$.ajax({
url: 'https://jsonplaceholder.typicode.com/posts',
method: 'POST',
headers: {'Content-Type': 'application/json; charset=UTF-8'},
body: JSON.stringify({
title: 'foo',
body: 'bar',
userId: 1,
}),
success: function(data){
console.log("data", data);
}
});
Instead of a POST, this is turned into a GET and retrieves items.
I see from this blog post that a knack partner was able to make a POST to another web service: https://www.soluntech.com/blog/how-to-upload-files-to-an-ftp-server-from-knack
Trying to understand why this is happening and how to fix it.