SlideServe
Menu
Préférences
© SlideServe · v2026

WEB API

michaelgreid avatar
18 diapositives · 910 Views · Jan 04, 2020

WEB API. API. is a set of subroutine definitions, protocols, and tools for building application software. Purpose API make it easier for developers to use certain technologies in building applications. API. APPLICATION PROGRAMMING INTERFACE. API. Documentation describing API:

WEB API - slide 1
01 / 18WEB API
1 / 17

Télécharger la présentation

WEB API
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. WEB API

  2. API

  3. is a set of subroutine definitions, protocols, and tools for building application software. Purpose API make it easier for developers to use certain technologies in building applications. API APPLICATION PROGRAMMING INTERFACE

  4. API • Documentation describing API: • List of functions (endpoints) • Calls (requests) • Returns (responses) • Implementations: • Library or framework that can be imported to develop an application • OS interfaces between an app and OS (POSIX, MacOS API, Windows API) • Remote APIs on remote servers

  5. WEB (Remote) APIs • A server-side programmatic interface allows the client application to communicate with the server • Based on one or more publicly exposed endpointsand a defined request–response message system. • Uses the network to provide its services

  6. NET Protocols • Address resolving and delivering packets • Transmission Control between applications over IP • Content container Level (application protocol) • Security Level • IP • TCP • HTTP • HTTPS • URL: Protocol + address + port + path on server (URI) _https://best.server.com:8080/API/endpoints/cars?brand=FERRARI&color=RED

  7. Web Services zhttps://best.server.com:8080/API/endpoints/cars?brand=FERRARI&color=RED DesktopApps INTERNET Endpoint Mobile apps WEB SERVER Requests Endpoint DB Endpoint Other servers Responses Endpoint Web API Endpoint Smart Teapot

  8. is an architectural style URL based services HTTP/HTTPS only JSON , XML, TEXT, HTML Authorization and security must be implemented separately Easy to implement SOAP vs REST SimpleObjectAccess Protocol REpresentationalStateTransfer • is a protocol • uses services interfaces • Works on top of any communication Protocol, even asynchronously (TCP HTTP FTP SMTP) • Only XML • Security and authorization are part of the protocol • Fully described and provide information to users (WSDL)

  9. Principles of REST • RESOURCES expose easily understood directory structure URIs. • REPRESENTATIONS transfer JSON or XML to represent data objects and attributes. • MESSAGES use HTTP methods explicitly (for example, GET, POST, PUT, and DELETE). • STATELESS interactions store no client context on the server between requests. The client holds session state.

  10. HTTP methods • GET - Retrieve information. GET requests must be safe and idempotent, meaning regardless of how many times it repeats with the same parameters, the results are the same • POST - Request that the resource at the URI do something with the provided entity • PUT - Store an entity at a URI. PUT can create a new entity or update an existing one. • PATCH - Update only the specified fields of an entity at a URI • DELETE - Request that a resource be removed; however, the resource does not have to be removed immediately. • HEAD, OPTIONS, TRACE and CONNECT

  11. SELECT rows INSERT new row UPDATE row DELETE row UPDATE certain field CRUD - HTTP REQUESTS IN REST HTTP Requests DB operations • GET • POST • PUT • DELETE • PATCH

  12. HTTP request status codes indicate the result of the HTTP request. • 1XX - informational • 2XX – success (200 -OK, 201 – Created,204 - No Content) • 3XX - redirection • 4XX - client error (400-Bad Request, 401 Unauthorized, 403 - Forbidden, 404 - PNF) • 5XX - server error

  13. Request Structure • A request line GET /images/logo.png HTTP/1.1 • Request header fields Accept-Language: en Content-Type: text/html Cookie: <cookie-list> • An empty line. • An optional message body. JSON, TEXT, XML

  14. Response Structure • A status line which includes the status code and reason message HTTP/1.1 200 OK • Response header fields Content-Type: text/html Allow: GET, HEAD. • An empty line. • An optional message body JSON, TEXT, XML

  15. _

  16. -

  17. _

  18. _