Answer the question
In order to leave comments, you need to log in
How to send a GET request with form-data?
Hello dear forum users.
I use a third-party API, so I can't change anything on the "other side".
I need to send data of type form-data using the GET
o_O method
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();
data.append('id', '0003175');
let config = {
method: 'get',
url: 'URL',
headers: {
'Cookie': 'cabinet-web=cabinet-web-duo',
...data.getHeaders()
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question