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 details)

Uploaded Source

File details

Details for the file sprockets.mixins.http-1.0.0.tar.gz.

File metadata

File hashes

Hashes for sprockets.mixins.http-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2b6983b9b5d77d006d7487c30ee385e9b8d6049df5175fb332677e2afd4024b
MD5 895e80f6a5e5e854231b5a00585639a0
BLAKE2b-256 aedcb426101c9f2e45b104ce0977f1f00326b6a55a31373d5601bc90ba8d4c42

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