Skip to content

Instantly share code, notes, and snippets.

@moaoa
Last active July 6, 2020 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moaoa/bb7deeabdd35edfcdb288e3591e751a5 to your computer and use it in GitHub Desktop.
Save moaoa/bb7deeabdd35edfcdb288e3591e751a5 to your computer and use it in GitHub Desktop.
const axios = require('axios')
// queryParams
axios.get(url, {
params:{
key: value
}
}
)
// output
GET url?key=value
//send json body
axios.post(url, {
kay: value
})
or
axios.post(url, {data: {
key: value
}})
@moaoa
Copy link
Author

moaoa commented Jul 6, 2020

// upload file * strict syntax
axios.post(url, forDataBody, options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment