Skip to content

Commit fb252b4

Browse files
committed
Add doc for raw request
1 parent 358ad9b commit fb252b4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/Usage/Request.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ Receive flask **`request.headers`**.
8383

8484
Receive flask **`request.cookies`**.
8585

86+
### raw
87+
88+
Receive flask **`request`** and no data validation.
89+
90+
```python
91+
from flask_openapi3 import RawModel
92+
93+
94+
class BookRaw(RawModel):
95+
mimetypes = ["text/csv", "application/json"]
96+
97+
98+
@app.post("/book")
99+
def get_book(raw: BookRaw):
100+
# raw equals to flask.request
101+
print(raw.data)
102+
print(raw.mimetype)
103+
return "ok"
104+
```
105+
86106
## Request model
87107

88108
First, you need to define a [pydantic](https://github.com/pydantic/pydantic) model:

0 commit comments

Comments
 (0)