Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Last active March 17, 2021 17:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/2881ad008af264025abd2b87a6207b6c to your computer and use it in GitHub Desktop.
Save kuc-arc-f/2881ad008af264025abd2b87a6207b6c to your computer and use it in GitHub Desktop.
axios, strapi post sample
{
"presets": [
"@babel/preset-env"
]
}
{
"name": "app12",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "nodemon --exec babel-node ./bin/www"
},
"dependencies": {
"axios": "^0.21.1"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/node": "^7.10.5",
"@babel/preset-env": "^7.11.0"
}
}
async function test2(){
var item = {
title: "t34",
content : "c34"
}
var d = await axios.post('http://localhost:1337/tasks'
,item
)
console.log(d)
}
// main
console.log("#main")
test2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment