liveBook · Manning

REST

As explained in Software Engineering for Data Scientists

A REST API is an application programming interface organized around the constraints and resource-oriented interactions of Representational State Transfer.

REST organizes an API around requests between a client and a remote service. The client does not need to know how the server computes results, and the server does not retain client state between requests. section 9.3.1

Common REST request types assign different jobs to client-server interactions:

  • GET retrieves data, such as search results. section 9.3.1
  • POST sends data to a server, such as submitted credentials. section 9.3.1
  • PUT replaces or updates server data, while PATCH changes only specified fields. section 9.3.1
  • DELETE removes data at a specified server location. section 9.3.1

Serving a customer-churn model

A client sends customer-churn inputs to a remote REST API over HTTPS. Server-side code can fetch features for a customer ID from a database, pass them to the model, and return the prediction. Another language or system can make the request while Python runs the prediction code. section 9.3.1

Figure 9.7 This view modifies Figure 9.6 to show how we can send the customer churn model inputs to a remote server. The model, which lives on the server, will be called to compute the model prediction and return the result to the client.
ch9 model api v1

Trace how model inputs travel from a client to a remote server, where the model computes and returns a prediction. section 9.3.1

How Software Engineering for Data Scientists covers it

How deep it goes
Defines statelessness, HTTPS transport, and request methods, but does not detail REST implementation internals.
Examples
Uses Google search, customer-churn predictions, database feature lookup, and cross-language API requests as examples.
What it assumes
Assumes only the client-server idea and explains API communication without requiring knowledge of server internals.
What you can do after
Apply it via HTTPS GET, POST, PUT, PATCH, and DELETE requests to interact with remote services and models.
How it connects
Connects REST with APIs, HTTPS, SOAP, machine learning models, databases, and FastAPI.

Also explained in

Compare how 30 books explain REST →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Engineering for Data Scientists. The section links point to the parts of the book it draws on.