Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active July 20, 2017 20:09
Show Gist options
  • Select an option

  • Save rogerwschmidt/8e7caf85b46a5460c8333fa42ae0d556 to your computer and use it in GitHub Desktop.

Select an option

Save rogerwschmidt/8e7caf85b46a5460c8333fa42ae0d556 to your computer and use it in GitHub Desktop.

REST Intructor Notes

Objectives

  • Describe what REST is.
  • Explain why REST is important.
  • Create a RESTful Express server.

What is REST?

  • Clients are concerned with user interface.
  • Servers are concerned with data persistence.
  • Clients and servers communicate over a well-defined HTTP contract.
  • Clients and servers think about data in terms of resources.
  • Clients send HTTP requests to create, read, update, and destroy resources.
  • Servers send HTTP responses to indicate the result of these operations.

CFU

Turn to your neighbor and summarize the definition REST. Be prepared to share with the class.

CFU

  • What is in the request body when you GET all? What are the identifiers in the request URL?
  • What is in the request body when you GET one? What are the identifiers in the request URL?
  • What is in the request body when you POST one? What are the identifiers in the request URL?
  • What is in the request body when you PATCH one? What are the identifiers in the request URL?
  • What is in the request body when you DELETE one? What are the identifiers in the request URL?

CFU

  • What is in the response body when you GET all?
  • What is in the response body when you GET one?
  • What is in the response body when you POST one?
  • What is in the response body when you PATCH one?
  • What is in the response body when you DELETE one?

Why is REST Important?

  • Turn and talk with your neighbor and discuss why REST is important. Be prepared to share with the class.

How do you create a RESTful express server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment