diff --git a/README.md b/README.md index 28a6f46..1c5bcc0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ # form -Rest form generator / validator with CSRF support \ No newline at end of file +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. +``` diff --git a/form.db b/form.db new file mode 100644 index 0000000..1740e46 Binary files /dev/null and b/form.db differ diff --git a/form.db-shm b/form.db-shm new file mode 100644 index 0000000..730ff52 Binary files /dev/null and b/form.db-shm differ diff --git a/form.db-wal b/form.db-wal new file mode 100644 index 0000000..4dcb476 Binary files /dev/null and b/form.db-wal differ