A
A
Alexey Shashenkov2017-02-17 19:25:28
Google Chrome
Alexey Shashenkov, 2017-02-17 19:25:28

Why doesn't it work in cross-domain delete?

I'm trying to do a cross domain delete request, it works fine. It passes options first, it gets headers from the server with the following content => response headers

Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:content-type
Access-Control-Allow-Methods:GET,HEAD,PUT,POST,DELETE
Access-Control-Allow-Origin:http://localhost:8081
Connection:keep-alive
Date:Fri, 17 Feb 2017 16:14:17 GMT

Next comes the delete request it also receives headers from the server => response headers
Access-Control-Allow-Credentials:true
Access-Control-Allow-Methods:GET,HEAD,PUT,POST,DELETE
Access-Control-Allow-Origin:http://localhost:8081
Connection:keep-alive
Content-Length:259
Content-Type:application/json; charset=utf-8
Date:Fri, 17 Feb 2017 16:14:17 GMT

But the problem is that there is no answer. Content-Length is there but neither error nor success is executed. Also, the priview and response are empty in the debugger. It's in chrome. But in Mazil, the answer is in the content of the answer, but the callbacks do not work. Perhaps this is due to some kind of browser protection. But there are no errors. But post and get work fine

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fredcapit, 2017-02-23
@Fredcapit

I had the same issue. Here is the documentation that helped me. True, I had a need for POST requests with JSON in the attachment, and I also used authentication, but browser security restrictions did not allow me to do this.
In short, the DELETE method cannot be used on Cross-domain.
Also there are restrictions on the ContentType that can be.
I recommend that you carefully read the proposed documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question