Skip to content

Instantly share code, notes, and snippets.

@mdang
Last active August 29, 2015 14:21
Show Gist options
  • Save mdang/97cc446d82bc6b32102b to your computer and use it in GitHub Desktop.
Save mdang/97cc446d82bc6b32102b to your computer and use it in GitHub Desktop.
HTTP Methods and REST API's

HTTP Methods and REST API's

Let's practice using some HTTP methods on some public REST API's. When accessing these API's, take note of the request and response headers being sent, as well as the response codes.

Tools

Use one of the following:

POST Method

Create a new object:

POST http://jsonplaceholder.typicode.com/posts

Request Parameters:

  • body
  • title

GET Method

Retrieve an existing object

GET http://jsonplaceholder.typicode.com/posts/1

Retrieve multiple objects

GET http://jsonplaceholder.typicode.com/posts

PUT/PATCH Method

Update an existing object

PUT http://jsonplaceholder.typicode.com/posts/1

Request Parameters:

  • body
  • title

DELETE Method

Delete an existing object

DELETE http://jsonplaceholder.typicode.com/posts/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment