liveBook · Manning

JSON

As explained in Road to Kubernetes

JSON is a text-based data interchange format representing structured values such as objects, arrays, strings, numbers, booleans, and null.

JSON is a text-based format for exchanging structured data between software. FastAPI converts a JSON-serializable Python dictionary into a response, while Express.js returns JSON for microservice communication. section 2.1.2 section 2.2.3

Web applications use JSON by:

  • Returning a Python dictionary that supports JSON serialization from a FastAPI route. section 2.1.2
  • Declaring a JavaScript object, converting it with JSON.stringify(), and returning it through Express.js. section 2.2.3

FastAPI response

A route such as / can return {"Hello": "World"}; FastAPI converts the JSON-serializable Python dictionary into JSON data.

Express.js response

An Express.js route can create {who: "rocket man", where: "mars"}, convert it with JSON.stringify(), and return the result with res.json().

How Road to Kubernetes covers it

How deep it goes
Explains practical serialization in Python and JavaScript, but stops short of broader format rules or advanced headers.
Examples
Uses FastAPI's Hello World dictionary and an Express.js rocket-man object as concrete response examples.
What you can do after
Build it from scratch by creating JSON responses in FastAPI and Express.js applications.
How it connects
Connects JSON with REST APIs, FastAPI, Express.js, Python dictionaries, JavaScript objects, and HTTP routes.

Also explained in

Compare how 35 books explain JSON →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.