Skip to content

Latest commit

 

History

History
98 lines (83 loc) · 3.36 KB

File metadata and controls

98 lines (83 loc) · 3.36 KB

Express

Review, Research, and Discussion

  1. What’s the difference between PUT and PATCH?
    • Both are used to update data on the server
    • PUT updates the whole resource. Can create resources, similar to how POST works, but can only do so if there is a defined URI
    • PATCH only updates part of the resource. Cannot create resources
  2. Provide links to 3 services or tools that allow you to “mock” an API for development like json-server
  3. Compare and contrast Swagger and APIDoc.js 1 Which HTTP status codes should be sent with each type of (un)successful API call?
    • both are API documentation tools
    • Swagger - used for implementing OpenAPI specification
    • APIDoc.js - "creates a documentation from API annotations in your source code" - apidocjs.com

Status Code Errors

4xx - Client Error

  • 400 Bad Request
  • 401 Unauthorized
  • 402 Payment Required
  • 403 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 406 Not Acceptable
  • 407 Proxy Authentication Required
  • 408 Request Timeout
  • 409 Conflict
  • 410 Gone
  • 411 Length Required
  • 412 Precondition Failed
  • 413 Payload Too Large
  • 414 Request-URI Too Long
  • 415 Unsupported Media Type
  • 416 Requested Range Not Satisfiable
  • 417 Expectation Failed
  • 418 I'm a teapot
  • 421 Misdirected Request
  • 422 Unprocessable Entity
  • 423 Locked
  • 424 Failed Dependency
  • 426 Upgrade Required
  • 428 Precondition Required
  • 429 Too Many Requests
  • 431 Request Header Fields Too Large
  • 444 Connection Closed Without Response
  • 451 Unavailable For Legal Reasons
  • 499 Client Closed Request

5×× - Server Error

  • 500 Internal Server Error
  • 501 Not Implemented
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • 505 HTTP Version Not Supported
  • 506 Variant Also Negotiates
  • 507 Insufficient Storage
  • 508 Loop Detected
  • 510 Not Extended
  • 511 Network Authentication Required
  • 599 Network Connect Timeout Error

source:httpstatuses.com

  1. Compare and contrast SOAP and ReST
    • Both used to define how APIs should be built
    • SOAP - Simple Object Access Protocol
      • protocol so it has built-in rules
      • makes it more rigid
    • REST - Representational State Transfer
      • more recent
      • architectural principles vs protocol
      • used for lightweight web services and mobile apps
      • more flexible - allows implementation of its recommendations up to developers

source: https://www.redhat.com/en/topics/integration/whats-the-difference-between-soap-rest

Vocabulary Terms

Web Server - software that accepts HTTP requests Express - a framework that provides access to server methods and properties. A server that is created with Express is an HTTP server. Routing - creating a path for network traffic between servers and clients WRRC - Web Request Response Cycle

Preview

  1. Which 3 things had you heard about previously and now have better clarity on?
    • Express, Web servers, Routing
  2. Which 3 things are you hoping to learn more about in the upcoming lecture/demo?
    • WRRC, PUT, PATCH
  3. What are you most excited about trying to implement or see how it works?
    • PUT and PATCH methods, API mocking