Skip to content

Instantly share code, notes, and snippets.

@re4388
Created June 21, 2020 10:22
Show Gist options
  • Select an option

  • Save re4388/b1e4e408ef0d79977b3b29d63da8a7fc to your computer and use it in GitHub Desktop.

Select an option

Save re4388/b1e4e408ef0d79977b3b29d63da8a7fc to your computer and use it in GitHub Desktop.
curl-example
// POST reqest to add the first post
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"id\":\"1\",\"title\":\"this title\",\"text\":\"this is text\",\"categories\":\"cat\"}" \
http://localhost:3000/posts
// POST reqest to add the second post
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"id\":\"2\",\"title\":\"this second title\",\"text\":\"this is second text\",\"categories\":\"dog\"}" \
http://localhost:3000/posts
// GET request to check the result
curl --request GET http://localhost:3000/posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment