Answer the question
In order to leave comments, you need to log in
Why is the server refusing to accept when sending data with a POST request (Axios)?
Hello.
There is such js-library Axios.
When you send data in a POST request to the server (PHP) like this:
" axios.post('site.com', 'session=1&text=blabla' )", then PHP accepts it in $_POST.
But when you post, in a different way: axios.post('site.com', { sessions:1, text: blabla }) . That answer is related to CORS, an error.
The question is why the server accepts the first option, and refuses the second option?
and how to fix it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question