mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
* axios.post .put .patch take data as the 2nd arg * rename formData to form * add warning about data not being sent * sort imports properly * passing an object as data sends it as json, not urlencoded
16 lines
389 B
JavaScript
Generated
16 lines
389 B
JavaScript
Generated
const axios = require('axios');
|
|
|
|
const response = await axios.put(
|
|
'http://localhost:28139/test/_security',
|
|
'{"admins":{"names":[], "roles":[]}, "readers":{"names":["joe"],"roles":[]}}',
|
|
{
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
},
|
|
auth: {
|
|
username: 'admin',
|
|
password: '123'
|
|
}
|
|
}
|
|
);
|