api-mate
api-mate copied to clipboard
Sending POST request returns with error but is not the case
When sending a POST request we get an error message : Server responded with status: 0: error
. But what truly happens is that the message is sent, correctly handled and we get the XML answer back.
Where do you see this error? In your browser's JS console?
This error is visible in the browser.
You mean this message below?
It is shown if the server responds with a status other than 200. Do you know the status your server is sending with the response?
Maybe checking status != 200
is bad, I'm thinking that it should accept all 2xx statuses as a success.
I am doing test directly on the default server :smile:
Here is the HTTP headers for the response of /api
request
HTTP/1.1 200 OK
Server nginx/1.4.6 (Ubuntu)
Date Sun, 14 Feb 2016 09:07:23 GMT
Content-Type text/xml;charset=utf-8
Transfer-Encoding chunked
Connection keep-alive
Cache-Control no-cache
P3P CP="No P3P policy available"
Expires 0
Hm, I see a 200 when inspecting the response in the browser as well. But jQuery returns a status 0 with a "very descriptive" error that says error
.
But the content of the response is empty, so BigBlueButton is not really responding with the XML.
Don't you get the error below in the console?
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://test-install.blindsidenetworks.com/bigbluebutton/api/. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
I see it. This is what is expected, since the server needs to have CORS configured to accept requests from a browser in another domain.