Last active
August 29, 2015 14:10
-
-
Save ashleygwilliams/f592f2b6970a7109d2f1 to your computer and use it in GitHub Desktop.
testing POST on piep
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
LIST POST | |
curl -H "Content-Type: application/json" -d '{"curator":"Ashley","curator_org":null,"collaborators":null,"name":"POST request TEST","description":"DO YOU EVEN POST BRO","version":"0.0.0","license":"MIT","keywords":null}' http://localhost:8080/api/0/lists | |
RESOURCE POST | |
curl -H "Content-Type: application/json" -d '{"author":"Ashley","author_org":null,"title":"POST?","description":"testtesttest","github_url":"https://github.com/tbranyen/angular-directive.git","keywords":null,"version":"5.0.0","license":"MIT"}' http://localhost:8080/api/0/resources |
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
app.post('/test', function(req, res){ | |
console.log("REQUEST HEADERS: ", req.headers); | |
console.log("REQUEST BODY: ", req.body); | |
res.send("CZECH YO CONSOLE"); | |
}); | |
app.get('/test', function(req, res){ | |
console.log("REQUEST HEADERS: ", req.headers); | |
console.log("REQUEST BODY: ", req.body); | |
res.send("CZECH YO CONSOLE"); | |
}); |
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
REQEST | |
curl -H "Content-Type: application/json" -d '{ | |
"author": "james", | |
"content": "test", | |
"version": "1.0.0" | |
}' http://localhost:8080/test | |
RESPONSE | |
REQUEST HEADERS: { 'user-agent': 'curl/7.30.0', | |
host: 'localhost:8080', | |
accept: '*/*', | |
'content-type': 'application/json', | |
'content-length': '70' } | |
REQUEST BODY: undefined |
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
REQUEST | |
curl --data "author=ashley&content=TEST&version=1" http://localhost:8080/test | |
RESPONSE | |
REQUEST HEADERS: { 'user-agent': 'curl/7.30.0', | |
host: 'localhost:8080', | |
accept: '*/*', | |
'content-length': '36', | |
'content-type': 'application/x-www-form-urlencoded' } | |
REQUEST BODY: undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment