PHP Post array empty on axios POST

前端 未结 3 1174
迷失自我
迷失自我 2021-02-14 21:54

I\'m trying out Vue 2.0 and axios and I\'ve got a little issue. When I try to send a post request using axios to my post.php file the $_POST array is always empty.

Post

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-14 22:37

    For me the problem was that I was using http instead of https in the url. The server returned http status code Permanently moved (to the https site). A browser or command line client (curl) follow these redirects. My code did not. Solution was to use https in the url.

提交回复
热议问题