We are accustomed to using application/json to submit, so we will specify contentType in ajax.
$.ajax({ url: "http://localhost:3000", type: "post", data: JSON.stringify({ test: '123' }), contentType: "application/json", success: function (data) { console.log(data); } })
But it is important to note that the data we submit must be a pure string. So generally use JSON.stringify() to convert it. Otherwise the backend cannot accept
But it is important to note that the data we submit must be a pure string. So generally use JSON.stringify() to convert it. Otherwise the backend cannot accept
But it is important to note that the data we submit must be a pure string. So generally use JSON.stringify() to convert it. Otherwise the backend cannot accept