Skip to main content

A responder framework to write responders to http requests

Project description

talkback

Respond with your response to requests

Use routes file to map url path to responders

See examples app in https://www.github.com/madhukumarseshadri/talkweb3

Examples of GET / POST / PUT / DELETE

Examples of managing formdata,

In the responder, self.qs is query string.

For GET / POST, form submission html forms,

use

self.processform()

in the responder to get the formdata [ url encoded or multipart or text/plain ]

After using processform, self.formdata.data is,

For GET, self.formdata.data is a dict of field names, value pairs and field name and values are python strings and percent decoded and plus sub-ed. Get the form values as shown below,

type,fieldvalue,filename,content_type=self.formdata.data['fieldname'] #or
type,fieldvalue,filename,content_type=self.formdata['fieldname']
#type - empty or b'f' with f denoting input is file
#fieldvalue -  contents of file as bytes or field value
#filename - name of the file if file
#content_type - content_type of file if file 

For POST, self.formdata.data - dict is byte field name value pairs if post is mutlipart/formdata For url encoding posts, default encoding is utf8 no need to provide, provide python supported encoding or none for bytes in self.processforms(encoding=None). For utf8, values are percent decoded and plus sub-ed

type,fieldvalue,filename,content_type=self.formdata.data['fieldname'] #or
type,fieldvalue,filename,content_type=self.formdata['fieldname']

For multipart/formdata with files,

type,fieldvalue,filename,content_type=self.formdata.data[b'fieldname'] or
type,fieldvalue,filename,content_type=self.formdata[b'file']
for type,fieldvalue,filename,content_type in self.formdata[b'files']:
	#input is multiple files

AJAX formdata GET and POST

GET / POST forms

See examples app

For PUT,

use self.processinput() within a responder

For DELETE

use self.processinput() within a responder

OPTIONS / HEAD / CONNECT AND TRACE for http server to manage

Examples for using session and cookies - see session.py in examples

fskeeper - keeps the sesson as file and pickles the session object to file sqlkeeper - keepes the session in the database in session table

Project details


Release history Release notifications | RSS feed

This version

1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talkback-1.4.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

talkback-1.4-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file talkback-1.4.tar.gz.

File metadata

  • Download URL: talkback-1.4.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for talkback-1.4.tar.gz
Algorithm Hash digest
SHA256 3c6464c9d7193883c04df2a1d17032ded83c3a5fe37702eb0e805048f5902459
MD5 ec00719a4990b27bc4fbba09114d5017
BLAKE2b-256 56539362f1b0985493b77aecbe66fe01383e76f606cd32410037d49987773c29

See more details on using hashes here.

File details

Details for the file talkback-1.4-py3-none-any.whl.

File metadata

  • Download URL: talkback-1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for talkback-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9e47dde4297c33bf9d81c77b8dda3c5b3cf879b959fa1c587bc9c2065b8174c2
MD5 c07c5d413fa8a78f650f05213abed333
BLAKE2b-256 29d5dcb2ae91bc233da0feee5df7a463edd09a46f6866f010d51be0faa08dc77

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page