reading-notes

View project on GitHub

Class8

Return to home page.

API Design

  • What does REST stand for?

Representational State Transfer

  • REST APIs are designed around a __ resources__.

  • What is an identifer of a resource? Give an example.

A URI that uniquely identifies that resource

  • What are the most common HTTP verbs?

GET, POST, PUT, PATCH, and DELETE.

  • What should the URIs be based on?

URIs should be based on nouns

  • Give an example of a good URI.

https://eu1.locationiq.com/v1/search.php?key=YOUR_ACCESS_TOKEN&q=SEARCH_STRING&format=json

  • What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing?

A web API that have more requests, which is bad as it lower the performance.

  • What status code does a successful GET request return?

status code 200 (OK)

  • What status code does an unsuccessful GET request return?

404 (Not Found).

  • What status code does a successful POST request return?

status code 200

  • What status code does a successful DELETE request return?

status code 204