axios send post to php 1

axios send post to php

var params = new URLSearchParams();
params.append('param1', 'value1');
params.append('param2', 'value2');
axios.post('/foo', params); 

Here is what the above code is Doing:
1. We create a new URLSearchParams object
2. We append our first parameter to it
3. We append our second parameter to it
4. We pass it as the data property in our axios request

Similar Posts