Metadata-Version: 2.1
Name: nstuff
Version: 0.2.1
Summary: nstuff is a replacement for cgi.MiniFieldStorage, nstuff parses CGI POST and GET data into a dict.
Home-page: https://github.com/superkabuki/nstuff
Author: Adrian of Doom
Author-email: spam@iodisco.com
Classifier: License :: OSI Approved :: Sleepycat License
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# 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
```py3
#!/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
```js
a@fu:~$ curl  https://iodisco.com/cb/nstuff.cgi?you=me

{"you": "me"}

```
* POST
```js
a@fu:~$ curl -d "say"="Hey Koolaid" https://iodisco.com/cb/nstuff.cgi

{"say": "Hey Koolaid"}

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

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

```
