Compare commits
2 Commits
ab19504738
...
5368ff9ee3
Author | SHA1 | Date | |
---|---|---|---|
5368ff9ee3 | |||
03f922c65a |
30
README.md
30
README.md
@ -1,3 +1,31 @@
|
|||||||
# form
|
# form
|
||||||
|
|
||||||
Rest form generator / validator with CSRF support
|
Rest form generator / validator with CSRF support
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```
|
||||||
|
async with aiohttp.ClientSession():
|
||||||
|
response = await aiohttp.post("[base_url]/create/",data=dict(
|
||||||
|
firstname=dict(
|
||||||
|
type="string",
|
||||||
|
max_length=20,
|
||||||
|
min_length=2,
|
||||||
|
required=True,
|
||||||
|
default=""
|
||||||
|
),
|
||||||
|
age=dict(
|
||||||
|
type="number",
|
||||||
|
min_value=16,
|
||||||
|
max_value=99,
|
||||||
|
required=False,
|
||||||
|
default=22
|
||||||
|
),
|
||||||
|
captcha=dict(
|
||||||
|
type="captcha",
|
||||||
|
width=100,
|
||||||
|
height=40
|
||||||
|
)
|
||||||
|
))
|
||||||
|
form = await response.json()
|
||||||
|
# form is now exactly your payload with an extra field called csrf.
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user