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.2.1.tar.gz (3.0 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.2.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nstuff-0.2.1.tar.gz
Algorithm Hash digest
SHA256 679e1ee9158d97660361a8e5a7029295b31893274689012694bda7d173913ecb
MD5 a04a65b670557e408f66a2913c6c4e70
BLAKE2b-256 c4e5964ba6bc35371eb8496c9edf92ded4c8e84ebe72b142bd103acea48d9887

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nstuff-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c7d3077accae7527cd9711346753ca553d4038b563087c42c99ad2506d62b13
MD5 805c4eae2818852c6e601cffe2cc2719
BLAKE2b-256 3396c18bdc7491bb721c91f4b2c28d3b6bb68f5e700cb029b65f8753ee8236b7

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