Metadata-Version: 1.1
Name: bottle_errorsrest
Version: 0.0.1
Summary: ErrorsRest plugin for bottle
Home-page: https://github.com/kianxineki/bottle-errorsrest
Author: Alberto Galera Jimenez
Author-email: galerajimenez@gmail.com
License: GPL
Description: Bottle Errors Rest
        ==================
        
        bottle\_errorsrest plugin for bottle
        
        All errors are now returned bottle json format.
        
        If HTTPError receives a string becomes {'message': string}
        
        installation
        ------------
        
        Via pip: ``pip install bottle_errorsrest``
        
        Or clone:
        ``git clone https://github.com/kianxineki/bottle_errorsrest.git``
        
        example server:
        ---------------
        
        .. code:: python
        
            from bottle import get, install, run, HTTPError
            from bottle_errorsrest import ErrorsRestPlugin
        
        
            @get("/")
            def example():
                # {'message': 'oh no!'}
                raise HTTPError(500, "oh no!")
        
        
            install(ErrorsRestPlugin())
        
            run(host="0.0.0.0", port="9988")
        
        Test:
        -----
        
        .. code:: bash
        
            curl http://localhost:9988/ --head; curl http://localhost:9988/
            HTTP/1.0 500 Internal Server Error
            Date: Tue, 27 Sep 2016 11:16:41 GMT
            Server: WSGIServer/0.2 CPython/3.4.3
            Content-Type: application/json
            Content-Length: 20
        
            {"prueba": "oh no!"}
        
            curl http://localhost:9988/not_found --head; curl http://localhost:9988/not_found
            HTTP/1.0 404 Not Found
            Date: Tue, 27 Sep 2016 11:11:39 GMT
            Server: WSGIServer/0.2 CPython/3.4.3
            Content-Length: 38
            Content-Type: application/json
        
            {"message": "Not found: '/not_found'"}
        
        
Keywords: bottle_errorsrest
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
