axios post formdata

علی ذوالفقار
1401/07/27 08:45:25 (55)
const axios = require('axios');
const FormData = require('form-data');

const body = new FormData();
body.append('form_item','value')

axios.post('https://endpoint', body , 
{ headers: body.getHeaders() ,  
  auth :{username : '...',password : '...'}
})
.then( r=> {})
.catch(e=>{})        


            
Back