Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

axios get data from json file

axios.get('data.json')
    .then(res => console.log(res.data))
    .catch(err => console.log(err)
Comment

sending api request in axios with files

 let headers = {
        Authorization: "token",
        'Content-Type':'multipart/form-data'
    };

let formData = new FormData();

 for(let key in files){
 
  formData.append('files[][file]', files[key].file, files[key].file.name)
  formData.append('files[][file_type_id]', files[key].fileType)
}

axios
    .post(
        "/api/files",
       formData,
        { headers }
    )
    .then(()=>{console.log('It Works')})
Comment

PREVIOUS NEXT
Code Example
Javascript :: ios/main.jsbundle no such file or directory react native 
Javascript :: javascript set max length of string 
Javascript :: spread operator javascript 
Javascript :: how do you swap the vaRIables js 
Javascript :: lodash find array of strings 
Javascript :: what is react 
Javascript :: js or 
Javascript :: get id in url params 
Javascript :: proxy nuxt 
Javascript :: Update select2 after removing an element 
Javascript :: CSRF token in js 
Javascript :: jspdf reduce size file 
Javascript :: convert datetime to timestamp javascript 
Javascript :: mysql JSON_SEARCH LIKE 
Javascript :: angular selector 
Javascript :: javascript template string 
Javascript :: set exit node tor 
Javascript :: get form data in js 
Javascript :: browser tab switch event js 
Javascript :: expresiones ternarias javascript 
Javascript :: mongoose update 
Javascript :: createelement with id 
Javascript :: select option filter javascript 
Javascript :: how to do an isogram in javascript 
Javascript :: javascript remove required attribute 
Javascript :: jquery function return 
Javascript :: chart js donut 
Javascript :: convert array to csv javascript 
Javascript :: javascript appendchild before 
Javascript :: how to prevent xss attacks in node js 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =