I need to send POST data to a server in another domain. This server uses SSL and expects the data to be in the form of a JSON string. I am trying to do this from javascript.
I am creating data and using JSON.stringify () to get it in the correct format. Then I send it as follows:
var url = "https://api.postageapp.com/v.1.0/send_message.json"; http=new XMLHttpRequest(); http.open("POST", url, true); http.setRequestHeader("Content-type", "application/json"); http.setRequestHeader("Connection", "close");
Perform packet tracing. I see that my client is shaking hands with the server, but then the server twice responds with an โEncrypted alertโ, including the last time it sends a packet back. The browser debugger always shows error 405 - Method Now Allowed.
What am I missing to get this to work? When they try it in their domain, it works fine.
source share