Last active
July 6, 2020 06:46
-
-
Save moaoa/bb7deeabdd35edfcdb288e3591e751a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// upload file * strict syntax
axios.post(url, forDataBody, options)