forked from sparckles/Robyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add form data handling and file handling (sparckles#778)
* feat: add form data handling and file handling --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7309086
commit e253acb
Showing
14 changed files
with
496 additions
and
48 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
docs_src/src/pages/documentation/api_reference/form_data.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export const description = | ||
'On this page, we’ll dive into using the form data.' | ||
|
||
## Fom Data | ||
|
||
Batman learned how to handle file uploads using Robyn. Now, he wanted to handle the form data | ||
|
||
|
||
## Handling Form Data | ||
|
||
<Row> | ||
<Col> | ||
Batman uploaded some multipart form data and wanted to handle it using the following code: | ||
</Col> | ||
<Col sticky> | ||
|
||
<CodeGroup title="Request" tag="GET" label="/hello_world"> | ||
|
||
```python {{ title: 'untyped' }} | ||
@app.post("/upload") | ||
async def upload(request): | ||
form_data = request.from_data | ||
|
||
return form_data | ||
``` | ||
```python {{ title: 'typed' }} | ||
@app.post("/upload") | ||
async def upload(request): | ||
form_data = request.from_data | ||
|
||
return form_data | ||
``` | ||
|
||
</CodeGroup> | ||
</Col> | ||
</Row> | ||
|
||
|
||
## What's next? | ||
|
||
Now, Batman was ready to learn about the advanced features of Robyn. He wanted to find a way to get realtime updates in his dashboard. | ||
|
||
- [WebSockets](/documentation/api_reference/websockets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.