POST not getting data but $.ajax does.
See original GitHub issueMaybe this is the problem with my understanding of Vue resource, but why does this work:
_this = this;
$.ajax({
type: 'POST',
url: requestURL,
async: false,
success: function (data) {
_this.$set('cartData', data);
}
});
But this does not:
this.$http.post(requestURL).then(function(response){
this.$set('cartData', data);
})
I get a “Headers already sent error”. Backend for this example is Symfony 2.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
jQuery AJAX/POST not sending data to PHP - Stack Overflow
You need to set the data type as json in ajax call. JQUERY CODE: $.ajax({ url: "ajax/add-user.php", type: "POST", dataType:'json', ...
Read more >jQuery $.ajax({}) not sending my POST data to server - Reddit
Hello everyone. I'm having a noobish issue with sending some stringified JSON back to my server. The code in question is this: var...
Read more >jquery ajax with passing data not working - ExpressionEngine
Code looks fine from what I can tell, no obvious problems. Can you use Firebug or something to inspect the request and make...
Read more >AJAX post request not posting all data - Forums - Liferay
Hi, I'm trying to do an AJAX post request in a portlet in Liferay 6.2. The URL is correct because I am getting...
Read more >jQuery AJAX POST Tutorial - AirPair
Let's break down the not-so-clear parts of the $.ajax() method. The dataType setting controls how data we receive from the server is treated....
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
@evertramos I think I did, but it was a long time ago. the project is finished, so I can’t check it now. But thanks for the suggestion.
Have you tried a simple:
this.cartData = data;