Skip to main content

nstuff is a replacement for cgi.MiniFieldStorage, nstuff parses CGI POST and GET data into a dict.

Project description

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"}

Project details


Download files

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

Source Distribution

nstuff-0.1.9.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nstuff-0.1.9-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file nstuff-0.1.9.tar.gz.

File metadata

  • Download URL: nstuff-0.1.9.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for nstuff-0.1.9.tar.gz
Algorithm Hash digest
SHA256 34767c5fda0a131777b0bb36e5c762bf807c59dbf20478aadc9d12f5685e4f98
MD5 94e3e389c27d9515caf57fcd531b0a71
BLAKE2b-256 2bd716877b3c672abef10cbd2b3116d3a082c4d293a54f209663ccac0691a6ec

See more details on using hashes here.

File details

Details for the file nstuff-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: nstuff-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for nstuff-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3a21d00b01351ca823f7a6cac22a2957f0f31678e313cd190d06a99b832ba331
MD5 91c3c6b249850794e3bba8be2c600eb9
BLAKE2b-256 b1f2022e99267a2af2bc056f475682c27ab2d156842e6d2e54170074b1ff04d7

See more details on using hashes here.

Supported by

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