Skip to main content

HTTP Client Mixin for Tornado RequestHandlers

Project description

HTTP Client Mixin for Tornado RequestHandlers.

Version Travis CodeCov Docs

Installation

sprockets.mixins.http is available on the Python Package Index and can be installed via pip or easy_install:

pip install sprockets.mixins.http

Documentation

https://pythonhosted.org/sprockets.mixins.http

Requirements

  • pycurl

  • tornado>=4.2.0,<5

Example

This examples demonstrates the most basic usage of sprockets.mixins.http

python my-example-app.py
from tornado import gen, web
from sprockets.mixins import amqp

def make_app(**settings):
    return web.Application(
        [
            web.url(r'/', RequestHandler),
        ], **settings)


class RequestHandler(http.HTTPClientMixin,
                     correlation.HandlerMixin,
                     web.RequestHandler):

    @gen.coroutine
    def get(self, *args, **kwargs):
        response = yield self.http_fetch('https://www.google.com')

License

sprockets.mixins.http is released under the 3-Clause BSD license.

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

sprockets.mixins.http-1.0.0.tar.gz (6.7 kB view hashes)

Uploaded Source

Supported by

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