Skip to main content

nstuff

CGI GET / POST data

Replacement for the now defunct cgi MiniFieldStorage

Parse GET and/or POST data into a dict

With a POST request you can parse POST data and the url query string.

Example: Return POST and GET data from a request as JSON

  • nstuff.cgi
#!/usr/bin/env python3

"""
Example nstuff cgi script to show GET and POST data.

"""
import json
from nstuff import nstuff

if __name__ == '__main__':
    formstuff = nstuff()
    print("Content-type: text/Json\n")
    print(json.dumps(formstuff))
  • GET
a@fu:~$ curl  https://iodisco.com/cb/nstuff.cgi?you=me

{"you": "me"}
  • POST
a@fu:~$ curl -d "say"="Hey Koolaid" https://iodisco.com/cb/nstuff.cgi

{"say": "Hey Koolaid"}
  • Both in a POST
a@fu:~$ curl -d "say"="Hey Koolaid" https://iodisco.com/cb/nstuff.cgi?adrian=iscool

{"adrian": "iscool", "say": "Hey Koolaid"}

Metadata

Release files for nstuff 0.2.1

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

Source distribution (sdist)

Source distribution for nstuff 0.2.1
File Size Uploaded
nstuff-0.2.1.tar.gz 3.0 kB Details

Built distribution (wheel)

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

Total release size: 6.3 kB

Release files / nstuff-0.2.1.tar.gz

Download URL nstuff-0.2.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
679e1ee9158d97660361a8e5a7029295b31893274689012694bda7d173913ecb
BLAKE2b-256 checksum
How to use checksums
c4e5964ba6bc35371eb8496c9edf92ded4c8e84ebe72b142bd103acea48d9887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / nstuff-0.2.1-py3-none-any.whl

Download URL nstuff-0.2.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c7d3077accae7527cd9711346753ca553d4038b563087c42c99ad2506d62b13
BLAKE2b-256 checksum
How to use checksums
3396c18bdc7491bb721c91f4b2c28d3b6bb68f5e700cb029b65f8753ee8236b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.9

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