POST API380
Pages:
1ecoenghk private msg quote post Address this user | ||
Hi, I use jquery ajax to do POST to update component description. Sometimes it works but sometimes not. Here is my code:
When the request fail, I only got OPTION but there is no POST. And the console shows:
And I found there is no "content-type" in the OPTION request response header (access-control-allow-headers:"accept, origin, x-requested-with, co$". When the request works the OPTION request response header is like this: (access-control-allow-headers:"accept, origin, x-requested-with, content-type". Is there anything that can help at Grovestreams server side? Thanks |
||
Post 1 IP flag post |
MThomas private msg quote post Address this user | ||
Where is your "Content-Length:"? I'm not too familiar with JQuery or AJAX. But for the HTTP part you usually have to send it a content length or sometimes it gets mad. I've seen it accept it though without a length. | ||
Post 2 IP flag post |
MikeMills private msg quote post Address this user | ||
If you're making the call from within a browser and you're browser is pointing at another domain besides GroveStreams.com, then you are making a Cross-domain call which most browsers restrict by default for security reasons. I think that might be your issue. There are ways to work around that and I believe J-Query has some settings built into their ajax object to help with it. Search for J-Query and Cross-domain for solutions. |
||
Post 3 IP flag post |
ecoenghk private msg quote post Address this user | ||
Thanks, but why sometimes the post request works but sometimes not? I think that will block all request if it is the browser restriction problem. Also, I use the jquery ajax to do PUT request and it works every time. So I suspect it is the problem of the POST. |
||
Post 4 IP flag post |
MikeMills private msg quote post Address this user | ||
There was a configuration typo for our web servers. Fixed it. Try it now and let me know if it works. | ||
Post 5 IP flag post |
Pages:
1