]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:memo: Improve explanation of request bodies
authorSebastián Ramírez <tiangolo@gmail.com>
Wed, 26 Dec 2018 15:01:15 +0000 (19:01 +0400)
committerSebastián Ramírez <tiangolo@gmail.com>
Wed, 26 Dec 2018 15:01:15 +0000 (19:01 +0400)
README.md
docs/index.md
docs/tutorial/body.md
docs/tutorial/intro.md

index 7020bcdbf1f9052cc402b154c52a51a447976d99..526ac7bbb3dbc27c122093b22e4cea45e4e17463 100644 (file)
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ The key features are:
 * **Easy**: Designed to be easy to use and learn. Less time reading docs.
 * **Short**: Minimize code duplication. Multiple features from each parameter declaration. Less bugs.
 * **Robust**: Get production-ready code. With automatic interactive documentation.
-* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" target="_blank">OpenAPI</a> and <a href="http://json-schema.org/" target="_blank">JSON Schema</a>.
+* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" target="_blank">OpenAPI</a> (previously known as Swagger) and <a href="http://json-schema.org/" target="_blank">JSON Schema</a>.
 
 <small>* estimation based on tests on an internal development team, building production applications.</small>
 
@@ -366,7 +366,7 @@ Used by FastAPI / Starlette:
 
 * <a href="http://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - for the server that loads and serves your application.
 
-You can install all of these with `pip3 install fastapi[full]`.
+You can install all of these with `pip3 install fastapi[all]`.
 
 ## License
 
index 14be55d6fefc37de53acdd40fb6e0b70e2d879d7..526ac7bbb3dbc27c122093b22e4cea45e4e17463 100644 (file)
@@ -366,7 +366,7 @@ Used by FastAPI / Starlette:
 
 * <a href="http://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - for the server that loads and serves your application.
 
-You can install all of these with `pip3 install fastapi[full]`.
+You can install all of these with `pip3 install fastapi[all]`.
 
 ## License
 
index d77510f4625843a2eb8332fc035161316f6fe974..98b1bfd454b3e06e2e58b50667eaaf9a0dfdbfd1 100644 (file)
@@ -1,4 +1,15 @@
-To declare a request body, you use <a href="https://pydantic-docs.helpmanual.io/" target="_blank">Pydantic</a> models with all their power and benefits.
+When you need to send data from a client (let's say, a browser) to your API, you send it as a **request body**.
+
+A **request** body is data sent by the client to your API. A **response** body is the data your API sends to the client.
+
+Your API almost always has to send a **response** body. But clients don't necessarily need to send **request** bodies all the time.
+
+To declare a **request** body, you use <a href="https://pydantic-docs.helpmanual.io/" target="_blank">Pydantic</a> models with all their power and benefits.
+
+!!! info
+    You cannot send a request body using a `GET` operation (HTTP method).
+
+    To send data, you have to use one of: `POST` (the more common), `PUT`, `DELETE` or `PATCH`.
 
 ## Import Pydantic's `BaseModel`
 
index 04028e6646d70cafff1528a8609ee7cf3df54c43..2faead19d3fb595aa20863836b55f14205132f48 100644 (file)
@@ -39,13 +39,13 @@ pip install fastapi[all]
     
     This is what you would probably do once you want to deploy your application to production:
 
-    ```bash
+    ```
     pip install fastapi
     ```
 
     Also install `uvicorn` to work as the server:
 
-    ```bash
+    ```
     pip install uvicorn
     ```