POST request not sending data to php script
See original GitHub issueSummary
I using the following axios in a vue script to send data to a php script. I not having any luck
Context
- Environment: *e.g.: vue 2.5, chrome 65, Mac OS 10.13
Vue Script
``
url = ‘http://localhost/testVue/testVue.php’; new Vue({ el: ‘#app’, data: { name:‘’, psswrd:‘’ }, methods:{ login: function(){ axios.post(url, { name: “this.name”, email: “this.psswrd” }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); } } }); ``
PHP script
`` $data = $_POST;
var_dump($data); ``
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
javascript - $.post not sending data to php script - Stack Overflow
$.post not sending data to php script · Look into the $.ajax() syntax. · check $_SERVER['REQUEST_METHOD'] . · Watch the request / response...
Read more >Http.request not sending POST data? (SOLVED) - Defold Forum
I have validated my php file by sending an http request using this site. The POST data I send there does appear in...
Read more >How do I send a POST request using PHP? - ReqBin
There are two options for sending POST requests from PHP: using the built-in Curl library and the CURL-less method that uses PHP's native ......
Read more >HTTP Request with POST data not working - Questions - n8n
Your PHP script doesn't understand your request as Body Content Type: Raw/Custom doesn't send a Content-Type header. Unless you were to set one ......
Read more >HTTP Methods GET vs POST - W3Schools
The POST Method · POST requests are never cached · POST requests do not remain in the browser history · POST requests cannot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A solution to the issue is to use a formData object ``
Thanks, did i have same problems with PHP and twig. And solved implemented the function: