liveBook · Manning

HTTP

As explained in Rust Servers, Services, and Apps

The Hypertext Transfer Protocol is an application-layer protocol for transferring resources and messages over networks.

HTTP is the application-layer protocol most commonly used by web services and web applications to communicate with the outside world. Its simplicity and universality make it the interface between distributed application components and browsers or other clients. section 1.1

HTTP can be learned from the network boundary upward: TCP carries raw byte streams, a conversion layer models HTTP messages, and a server maps requests to responses. REST, gRPC, and WebSockets build communication techniques around HTTP and TCP. section 2.0

A practical Rust progression uses HTTP to build increasingly useful services:

  • Build a basic HTTP server with the Rust standard library, serving static pages and JSON data. section 2.0
  • Test requests and responses with cURL and a web browser. section 2.0
  • Expose REST APIs through Actix routes, handlers, request extractors, HttpResponse, and application state. section 3.0 section 3.3

HTTP request flow in Actix

A client sends a RESTful API request over HTTP to an Actix HttpServer listening on a port. The application selects a route by path and HTTP method, invokes its handler, and returns an HttpResponse. section 3.3

Figure 1.1 A simplified distributed systems stack for a social media application

Use the distributed-systems stack to place HTTP between web applications and the underlying networking, operating-system, and hardware infrastructure. section 1.1

How Rust Servers, Services, and Apps covers it

How deep it goes
Builds TCP servers, byte-stream conversion, static-page and JSON responses, then stops short of production-ready completeness.
Examples
Uses Rust servers, static pages, JSON data, REST APIs, cURL, browsers, Actix routes, and a distributed social-media stack.
What you can do after
Build basic HTTP servers, expose REST APIs, test them with cURL or browsers, and troubleshoot higher-level backend services.
How it connects
Relates HTTP to TCP, REST, gRPC, WebSockets, QUIC, distributed systems, routes, handlers, and application state.

Also explained in

Compare how 8 books explain HTTP →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.