<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
    <title>Pycnic Docs</title>
    <link>http://pycnic.nullism.com//docs</link>
    <description>Pycnic, a tinsy web framework for JSON APIs.</description>
    
    <item>
        <title>Working with CORS</title>
        <link>http://pycnic.nullism.com//docs/example-cors.html</link>
        <pubDate>Sun, 29 Oct 2017 12:30:00 EDT</pubDate>
        <description> Working with CORS Traditionally, to enable CORS on a resource, you simply need to ensure that the `Access-Control-Allow-Origin` header is set for the domains that you would like to enable access from. See [MDN Cross-Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) for more information about the header.  Full example :::python !/usr/bin/env python3 from pycnic.core...</description>
    </item>    
    
    <item>
        <title>WSGI Class</title>
        <link>http://pycnic.nullism.com//docs/wsgi-class.html</link>
        <pubDate>Sun, 23 Jul 2017 14:15:11 EDT</pubDate>
        <description> WSGI Class  Configuration The WSGI class contains several configuration properties for use in your `app` subclass. :::python class app(pycnic.core.WSGI):  logger: A Python logging Logger instance logger = logging.Logger(__name__)  before: A function that accepts a WSGI instance  as its first argument. Executed before dispatching  the...</description>
    </item>    
    
    <item>
        <title>WSGI Server Examples</title>
        <link>http://pycnic.nullism.com//docs/wsgi-servers.html</link>
        <pubDate>Fri, 14 Jul 2017 05:22:00 EDT</pubDate>
        <description>Webservers and running Pycnic</description>
    </item>    
    
    <item>
        <title>Benchmarks</title>
        <link>http://pycnic.nullism.com//docs/benchmarks.html</link>
        <pubDate>Sat, 04 Feb 2017 11:42:11 EST</pubDate>
        <description> Pycnic Bench (heh) Pycnic benchmarks were ran with two [Gunicorn](http://gunicorn.org) workers and hit with `ab -n 5000 -c 5` against a JSON endpoint (/json). *Note: the express.js benchmark can be located at [[nodejs-compare]].* * a href="https://github.com/nullism/pycnic/tree/master/benchmark"Source code span class="fontawesome-github"/span/a {tpl:thumb} image: http://pycnic.nullism.com/images/pycnic-bench.png max_width: 736px {endtpl}...</description>
    </item>    
    
    <item>
        <title>Node.js Comparison</title>
        <link>http://pycnic.nullism.com//docs/nodejs-compare.html</link>
        <pubDate>Sat, 04 Feb 2017 11:30:52 EST</pubDate>
        <description> Async NodeJS compared to Pycnic The purpose of these benchmarks was to test the claim that node.js's non-blocking nature is faster than other production webservers. The most popular web framework for Node.js is Express.js, by at least one order of magnitude (github stars). While Pycnic is definitely not the...</description>
    </item>    
    
    <item>
        <title>Request class</title>
        <link>http://pycnic.nullism.com//docs/request-class.html</link>
        <pubDate>Sun, 15 May 2016 13:11:45 EDT</pubDate>
        <description> Request Class The request instance provided in self.request contains the following properties. :::python  cookies: A dictionary of client cookies  in the format of { cookie name: cookie value } cookies = {}  headers: A dictionary of title-case headers  in the format of { Header-Name: value...</description>
    </item>    
    
    <item>
        <title>Support</title>
        <link>http://pycnic.nullism.com//docs/support.html</link>
        <pubDate>Mon, 09 Nov 2015 20:10:42 EST</pubDate>
        <description> Support Please file an issue on Github. a href="https://github.com/nullism/pycnic/issues/new"New Support Issue span class="fontawesome-github"/span/a...</description>
    </item>    
    
    <item>
        <title>Download</title>
        <link>http://pycnic.nullism.com//docs/download.html</link>
        <pubDate>Mon, 09 Nov 2015 20:06:41 EST</pubDate>
        <description> Download Pycnic Pycnic is open source and licensed under [MIT](https://opensource.org/licenses/MIT).  Source Code Via GitHub: [github.com/nullism/pycnic](https://github.com/nullism/pycnic). git clone https://github.com/nullism/pycnic.git Via PyPI: [pypi.python.org/pypi/pycnic](https://pypi.python.org/pypi/pycnic)  Installation Via pip: pip install pycnic  Upgrade Via pip: pip install pycnic --upgrade...</description>
    </item>    
    
    <item>
        <title>Response Class</title>
        <link>http://pycnic.nullism.com//docs/response-class.html</link>
        <pubDate>Sun, 08 Nov 2015 23:44:54 EST</pubDate>
        <description> Response Class The Response class contains data to be sent back to the client. :::python  cookies: A dictionary of cookies to be sent to the client. cookies = {}  set_header: A method that sets headers  to be sent back to the client set_header(self, key, value) ...</description>
    </item>    
    
    <item>
        <title>Full authentication example</title>
        <link>http://pycnic.nullism.com//docs/example-full-auth.html</link>
        <pubDate>Sun, 08 Nov 2015 21:00:00 EST</pubDate>
        <description> Full Authentication Example This example handles the following operations: 1. Create a database in memory with `users` and `user_sessions` tables. 2. Provides a `/login` handler which sets up a session. 3. Provides a `/home` handler which checks for a session. 4. Provides a `/logout` handler which deletes a session....</description>
    </item>    
    
    <item>
        <title>Working with Cookies</title>
        <link>http://pycnic.nullism.com//docs/example-cookies.html</link>
        <pubDate>Sat, 07 Nov 2015 09:00:00 EST</pubDate>
        <description> Working with Cookies Cookies can be accessed in the `request` and `response` objects.  Read To read a cookie: :::python self.request.cookies  Dictionary of all client-cookies self.request.cookies.get("Cookie name")  get a specific cookie  Set Setting a cookie only requires a key and value for the cookie. To set...</description>
    </item>    
    
    <item>
        <title>Example Error Handling</title>
        <link>http://pycnic.nullism.com//docs/example-errors.html</link>
        <pubDate>Thu, 05 Nov 2015 22:21:00 EST</pubDate>
        <description> Example error handling `pycnic.errors` provides several exception classes. * HTTPError - The parent error. * HTTP_400/401/403/404/405 - For 4xx client errors. * HTTP_500 - For 5xx server errors. The Pycnic framework catches these built-in exceptions and returns json describing the error (defined in the exception's `response` method). The `response`...</description>
    </item>    
    
    <item>
        <title>Example Authentication Wrapper</title>
        <link>http://pycnic.nullism.com//docs/example-auth-wrapper.html</link>
        <pubDate>Tue, 03 Nov 2015 23:45:00 EST</pubDate>
        <description> Example Authentication Wrapper Handling authentication with a wrapper just *feels* clean. :::python from functools import wraps from pycnic.core import WSGI, Handler from pycnic.errors import HTTP_401 def get_user_role(request):  Normally you'd do something like  check for request.cookies["session_id"]  existing in memcache or a database, but  for now... everyone's...</description>
    </item>    
    
    <item>
        <title>Example validation</title>
        <link>http://pycnic.nullism.com//docs/example-validation.html</link>
        <pubDate>Sat, 03 Oct 2015 23:02:00 EDT</pubDate>
        <description> Example Validation  Using before The traditional way to handle validation is implementing a `before` method on the handler. :::python from pycnic.core import Handler, WSGI from pycnic.errors import HTTP_400 class NameHandler(Handler): def before(self): if 'name' not in self.request.data \ or self.request.data['name'] != 'root': raise HTTP_400("Expected 'root' as name") def...</description>
    </item>    
    
    <item>
        <title>Example request data</title>
        <link>http://pycnic.nullism.com//docs/example-request.html</link>
        <pubDate>Sat, 03 Oct 2015 23:02:00 EDT</pubDate>
        <description> Example of the request object The requests instance of the Request class contains information about... requests. :::python from pycnic.core import Handler, WSGI from pycnic.errors import HTTP_400 class UsersHandler(Handler): def post(self): if not self.request.data.get("username"): raise HTTP_400("Yo dawg, you need to provide a username") return { "username":self.request.data["username"], "authID":self.request.cookies.get("auth_id"), "yourIp":self.request.ip, "rawBody":self.request.body, "method":self.request.method,...</description>
    </item>    
    
    <item>
        <title>Getting started</title>
        <link>http://pycnic.nullism.com//docs/getting-started.html</link>
        <pubDate>Sat, 03 Oct 2015 22:19:00 EDT</pubDate>
        <description> Getting Started  Install The easiest way to install Pycnic is though `pip`. pip install pycnic Or, for Python 3: pip3 install pycnic Now Pycnic is ready to be used.  Making an App Let's create a new file called `quote.py` :::python  quote.py from pycnic.core import WSGI, Handler...</description>
    </item>    
    
    <item>
        <title>Introduction</title>
        <link>http://pycnic.nullism.com//docs/index.html</link>
        <pubDate>Thu, 01 Oct 2015 20:22:00 EDT</pubDate>
        <description>Pycnic, the JSON API framework</description>
    </item>    
    
</channel>
</rss>