Skip to main content

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

Metadata

Release files for talkback 1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for talkback 1.5
File Interpreter ABI Platform
talkback-1.5-py3-none-any.whl Python 3 none any Details

Release files / talkback-1.5-py3-none-any.whl

Download URL talkback-1.5-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f22a5135a14db84f5c456ddd20fd5247cfe2e8b847ae7507738e9381a33c9af0
BLAKE2b-256 checksum
How to use checksums
3ce88f7d358131b20cae202f34dc1424f4d555cd10e4dbf959fe3edce1589a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.5 This release

1 release file

1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page