HTTP request/response parser for python in C

Overview

http-parser

HTTP request/response parser for Python compatible with Python 2.x (>=2.7), Python 3 and Pypy. If possible a C parser based on http-parser from Ryan Dahl will be used.

http-parser is under the MIT license.

Project url: https://github.com/benoitc/http-parser/

Build Status

Requirements:

  • Python 2.7 or sup. Pypy latest version.
  • Cython if you need to rebuild the C code (Not needed for Pypy)

Installation

$ pip install http-parser

Or install from source:

$ git clone git://github.com/benoitc/http-parser.git
$ cd http-parser && python setup.py install

Note: if you get an error on MacOSX try to install with the following arguments:

$ env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install

Usage

http-parser provide you parser.HttpParser low-level parser in C that you can access in your python program and http.HttpStream providing higher-level access to a readable,sequential io.RawIOBase object.

To help you in your day work, http-parser provides you 3 kind of readers in the reader module: IterReader to read iterables, StringReader to reads strings and StringIO objects, SocketReader to read sockets or objects with the same api (recv_into needed). You can of course use any io.RawIOBase object.

Example of HttpStream

ex:

#!/usr/bin/env python
import socket

from http_parser.http import HttpStream
from http_parser.reader import SocketReader

def main():
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        s.connect(('gunicorn.org', 80))
        s.send("GET / HTTP/1.1\r\nHost: gunicorn.org\r\n\r\n")
        r = SocketReader(s)
        p = HttpStream(r)
        print p.headers()
        print p.body_file().read()
    finally:
        s.close()

if __name__ == "__main__":
    main()

Example of HttpParser:

#!/usr/bin/env python
import socket

# try to import C parser then fallback in pure python parser.
try:
    from http_parser.parser import HttpParser
except ImportError:
    from http_parser.pyparser import HttpParser


def main():

    p = HttpParser()
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    body = []
    try:
        s.connect(('gunicorn.org', 80))
        s.send("GET / HTTP/1.1\r\nHost: gunicorn.org\r\n\r\n")

        while True:
            data = s.recv(1024)
            if not data:
                break

            recved = len(data)
            nparsed = p.execute(data, recved)
            assert nparsed == recved

            if p.is_headers_complete():
                print p.get_headers()

            if p.is_partial_body():
                body.append(p.recv_body())

            if p.is_message_complete():
                break

        print "".join(body)

    finally:
        s.close()

if __name__ == "__main__":
    main()

You can find more docs in the code (or use a doc generator).

Copyright

2011-2020 (c) Benoît Chesneau <[email protected]>

Comments
  • pypi install of http_parser fails with python 3.7

    pypi install of http_parser fails with python 3.7

    http_parser 0.8.3 in pypi does not install with python 3.7 due to C structures changing.

    This is causing problems for packages upstream. We develop Toil https://pypi.org/project/toil/ which uses pymesos https://pypi.org/project/pymesos/, which uses http_parser. Our users depend on installing from pypi, so we can't work around it externally without forking both packages.

    http_parsers hasn't been updated since 2013. Please address this issue.

    %python --version Python 3.7.5 pip install http_parser

    produces the attached output http_parser.log.txt

    opened by diekhans 14
  • pip3 install http_parser compile error

    pip3 install http_parser compile error

    pip install --global-option build_ext http_parser c:\users\admin\appdata\local\programs\python\python37-32\lib\site-packages\pip_internal\commands\install.py:211: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options. cmdoptions.check_install_build_global(options) Collecting http_parser Using cached https://files.pythonhosted.org/packages/07/c4/22e3c76c2313c26dd5f84f1205b916ff38ea951aab0c4544b6e2f5920d64/http-parser-0.8.3.tar.gz Installing collected packages: http-parser Running setup.py install for http-parser ... error Complete output from command c:\users\admin\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Admin\AppData\Local\Temp\pip-install-u90otn1h\http-parser\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext install --record C:\Users\Admin\AppData\Local\Temp\pip-record-9jb7firz\install-record.txt --single-version-externally-managed --compile: running build_ext building 'http_parser.parser' extension creating build creating build\temp.win32-3.7 creating build\temp.win32-3.7\Release creating build\temp.win32-3.7\Release\http_parser C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iparser -Ic:\users\admin\appdata\local\programs\python\python37-32\include -Ic:\users\admin\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tchttp_parser\http_parser.c /Fobuild\temp.win32-3.7\Release\http_parser\http_parser.obj http_parser.c C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iparser -Ic:\users\admin\appdata\local\programs\python\python37-32\include -Ic:\users\admin\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tchttp_parser\parser.c /Fobuild\temp.win32-3.7\Release\http_parser\parser.obj parser.c http_parser\parser.c(6249): error C2039: 'exc_type': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(6250): error C2039: 'exc_value': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(6251): error C2039: 'exc_traceback': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(6252): error C2039: 'exc_type': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(6253): error C2039: 'exc_value': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(6254): error C2039: 'exc_traceback': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7460): error C2039: 'exc_type': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7461): error C2039: 'exc_value': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7462): error C2039: 'exc_traceback': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7474): error C2039: 'exc_type': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7475): error C2039: 'exc_value': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7476): error C2039: 'exc_traceback': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7477): error C2039: 'exc_type': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7478): error C2039: 'exc_value': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' http_parser\parser.c(7479): error C2039: 'exc_traceback': is not a member of '_ts' c:\users\admin\appdata\local\programs\python\python37-32\include\pystate.h(212): note: see declaration of '_ts' error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2

    ----------------------------------------
    

    Command "c:\users\admin\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Admin\AppData\Local\Temp\pip-install-u90otn1h\http-parser\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext install --record C:\Users\Admin\AppData\Local\Temp\pip-record-9jb7firz\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-u90otn1h\http-parser\

    C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\Scripts>pip3 install http_parser

    opened by SailM23 12
  • AttributeError: '_io.BufferedReader' object has no attribute 'execute'

    AttributeError: '_io.BufferedReader' object has no attribute 'execute'

      File "/opt/deploy2.7/local/lib/python2.7/site-packages/restkit/client.py", line 345, in perform
        return self.get_response(request, conn)
      File "/opt/deploy2.7/local/lib/python2.7/site-packages/restkit/client.py", line 450, in get_response
        location = p.headers().get('location')
      File "/opt/deploy2.7/local/lib/python2.7/site-packages/http_parser/http.py", line 135, in headers
        self._check_headers_complete()
      File "/opt/deploy2.7/local/lib/python2.7/site-packages/http_parser/http.py", line 55, in _check_headers_complete
        next(self)
      File "/opt/deploy2.7/local/lib/python2.7/site-packages/http_parser/http.py", line 202, in __next__
        nparsed = self.parser.execute(to_parse, recved)
    AttributeError: '_io.BufferedReader' object has no attribute 'execute'
    

    Python 2.7.

    opened by pigmej 8
  • tests + handle a strange bug from python3 apis

    tests + handle a strange bug from python3 apis

    this set of changes introduces tox.ini, a behavior tests and a fix that deals with the bad behaviour from python3 SocketIO returning None on blocking ops

    opened by RonnyPfannschmidt 8
  • TypeError being thrown on restkit.request() to SSL site.

    TypeError being thrown on restkit.request() to SSL site.

    Traceback (most recent call last):
      File "1", line 5, in <module>
        restkit.request('https://www.google.com/')
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/restkit/__init__.py", line 107, in request
        headers=headers)
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/restkit/client.py", line 458, in request
        return self.perform(request)
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/restkit/client.py", line 389, in perform
        return self.get_response(request, connection)
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/restkit/client.py", line 495, in get_response
        location = p.headers().get('location')
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/http_parser/http.py", line 118, in headers
        self._check_headers_complete() 
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/http_parser/http.py", line 63, in _check_headers_complete
        data = self.next()
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/http_parser/http.py", line 175, in next
        recved = self.stream.readinto(b)
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/http_parser/reader.py", line 164, in readinto 
        return _readinto(self._sock, b)
      File "/Users/dsully/.virtualenvs/lib/python2.6/site-packages/http_parser/reader.py", line 39, in _readinto
        recved = sock.recv_into(buf)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py", line 98, in <lambda>
        self.recv_into = lambda buffer, nbytes=None, flags=0: SSLSocket.recv_into(self, buffer, nbytes, flags)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py", line 240, in recv_into
        buffer[:v] = tmp_buffer
    TypeError: can only assign array (not "str") to array slice
    
    opened by dsully 5
  • deflate decompress error

    deflate decompress error

    I got this when decompressing a deflate-encoded response from http://baike.baidu.com/view/262.htm :

    Exception zlib.error: 'Error -3 while decompressing data: incorrect header check' in 'http_parser.parser.on_body_cb' ignored
    

    According to this, -zlib.MAX_WBITS should be passed to zlib.decompressobj. And it solved my problem.

    opened by lilydjwg 4
  • Two WSGI environ bug fixes.

    Two WSGI environ bug fixes.

    The Content-Type header was not being correctly handled. If it wasn't sent exactly as "CONTENT-TYPE" it was getting recorded in the environ as "HTTP_CONTENT_TYPE" which is against PEP-333.

    In the pure-Python parser, the SCRIPT_NAME field was being mishandled due to mutation of the original environ. The code was looking for HTTP_SCRIPT_NAME which was already popped from the environ dictionary if it existed.

    opened by dowski 4
  • included version of C http-parser doesn't build on x64 Windows

    included version of C http-parser doesn't build on x64 Windows

    This was fixed in the upstream version of that code a few months ago: https://github.com/joyent/http-parser/commit/8ee3b0dc933ffe3f1d2a19965880026dfb626892

    opened by SteelPangolin 4
  • install from pip

    install from pip

    Hello,

    It seems that the install of the http-parser through pip gets wrong while it tries to reach https://pypi.python.org/simple/http-parse/ since it should be https://pypi.python.org/simple/http-parser/ .

    See (the log /home/userHome/.pip/pip.log): Getting page https://pypi.python.org/simple/http-parse/ Could not fetch URL https://pypi.python.org/simple/http-parse/: 404 Client Error: Not Found Will skip URL https://pypi.python.org/simple/http-parse/ when looking for download links for http-parse .....

    Still, I am a very newbie, so not sure if I am not saying anything stupid.

    Regards. Hellfar.

    opened by Hellfar 3
  • force pyparser when gevent is being used

    force pyparser when gevent is being used

    C-implementation is not working well with gevent async library. Python implementation does work. I've added an additional check to force pyparser when gevent monkey patching is detected.

    opened by muodov 3
  • Python parser to behave like c parser when no headers in message

    Python parser to behave like c parser when no headers in message

    Just discovered that the python parser does not behave the same way as the c parser when a client receives a message without headers (check the test_no_headers below). Maybe this little fix could do the trick?

    opened by lsbardel 3
  • Access to Trailer fields

    Access to Trailer fields

    Trailer fields are parsed but the resulting values are not made available to the API. A get_trailers() function should be added alongside get_headers().

    opened by jricher 0
  • Build fails on python3.11

    Build fails on python3.11

    The build of http-parser fails on python 3.11.0rc1 with

      Building wheel for http-parser (setup.py): started
      Building wheel for http-parser (setup.py): finished with status 'error'
      error: subprocess-exited-with-error
      
      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> [25 lines of output]
          /tmp/pip-install-raazgjz0/http-parser_212840a36e3a4d6cbbe9aee814b6db82/setup.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
            from imp import load_source
          running bdist_wheel
          running build
          running build_py
          creating build
          creating build/lib.linux-x86_64-3.11
          creating build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/util.py -> build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/_socketio.py -> build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/reader.py -> build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/__init__.py -> build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/pyparser.py -> build/lib.linux-x86_64-3.11/http_parser
          copying http_parser/http.py -> build/lib.linux-x86_64-3.11/http_parser
          running build_ext
          building 'http_parser.parser' extension
          creating build/temp.linux-x86_64-3.11
          creating build/temp.linux-x86_64-3.11/http_parser
          gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iparser -I/root/git/daas/venv311/include -I/root/.pyenv/versions/3.11.0rc1/include/python3.11 -c http_parser/http_parser.c -o build/temp.linux-x86_64-3.11/http_parser/http_parser.o
          gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iparser -I/root/git/daas/venv311/include -I/root/.pyenv/versions/3.11.0rc1/include/python3.11 -c http_parser/parser.c -o build/temp.linux-x86_64-3.11/http_parser/parser.o
          http_parser/parser.c:196:12: fatal error: longintrepr.h: No such file or directory
             #include "longintrepr.h"
                      ^~~~~~~~~~~~~~~
          compilation terminated.
          error: command '/usr/bin/gcc' failed with exit code 1
          [end of output]
    

    This is caused by the changed location of longintrepr. See https://docs.python.org/3.11/whatsnew/3.11.html and https://github.com/python/cpython/issues/79315

    opened by kasium 0
  • Failed building wheel for http-parser | http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory

    Failed building wheel for http-parser | http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory

    Full log :

    pip install git+https://github.com/benoitc/http-parser 
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
    Defaulting to user installation because normal site-packages is not writeable
    Collecting git+https://github.com/benoitc/http-parser
      Cloning https://github.com/benoitc/http-parser to /tmp/pip-req-build-ilQJuJ
      Running command git clone -q https://github.com/benoitc/http-parser /tmp/pip-req-build-ilQJuJ
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... done
    Building wheels for collected packages: http-parser
      Building wheel for http-parser (PEP 517) ... error
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python2 /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmplnGbGj
           cwd: /tmp/pip-req-build-ilQJuJ
      Complete output (24 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/_socketio.py -> build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/pyparser.py -> build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/util.py -> build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/__init__.py -> build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/http.py -> build/lib.linux-x86_64-2.7/http_parser
      copying http_parser/reader.py -> build/lib.linux-x86_64-2.7/http_parser
      running build_ext
      make: Nothing to be done for 'all'.
      building 'http_parser.parser' extension
      creating build/temp.linux-x86_64-2.7
      creating build/temp.linux-x86_64-2.7/http_parser
      x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Iparser -I/usr/include/python2.7 -c http_parser/http_parser.c -o build/temp.linux-x86_64-2.7/http_parser/http_parser.o
      x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Iparser -I/usr/include/python2.7 -c http_parser/parser.c -o build/temp.linux-x86_64-2.7/http_parser/parser.o
      http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory
          4 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      ----------------------------------------
      ERROR: Failed building wheel for http-parser
    Failed to build http-parser
    ERROR: Could not build wheels for http-parser which use PEP 517 and cannot be installed directly
    
    
    opened by maifeeulasad 0
  • New release - wheels?

    New release - wheels?

    I built a wheel from current master on Python3.7 and so far have seen no issues when using the library.

    I am willing to contribute wheels & eggs for MacOS if needed.

    opened by petri 2
  • extra space on long header values

    extra space on long header values

    I get an extra space when parsing a Location header with 1178 bytes in its value.

    The URL is https://one.angry.im/images/2018/06/14/qvxgoY.jpg?o and it redirects to a really long URL.

    improvement 
    opened by lilydjwg 0
Releases(0.8.3)
  • 0.8.3(Aug 30, 2013)

    http-parser version 0.8.3 has been released. This is a bug fix release.

    Changes

    • fix: deflate compression in the Python parser
    • fix: license date

    More

    Latest version is also available on Pypi:

    https://pypi.python.org/pypi/http-parser/0.8.3

    Source code(tar.gz)
    Source code(zip)
  • 0.8.2(Aug 30, 2013)

    http-parser version 0.8.2 has been released. This is a bug fix release, some minor features have also been added:

    Changes

    • add: header_only option to the C parser.
    • add: parser_class argument to the HttpStream object to test different parsers and eventually force the type of the parser used.
    • add: expose C parser errors in get_errno function.
    • fix: on_message_complete when the socket has closed immediately
    • fix: HttpParser.get_headers() when repeated or continuation headers appear.
    • fix: HttpParser.get_method() now return a native string on Python3
    • fix: deflate compression with some servers

    More

    Latest version is also available on Pypi:

    https://pypi.python.org/pypi/http-parser/0.8.2

    Source code(tar.gz)
    Source code(zip)
Owner
Benoit Chesneau
Benoit Chesneau
HTTP Request Smuggling Detection Tool

HTTP Request Smuggling Detection Tool HTTP request smuggling is a high severity vulnerability which is a technique where an attacker smuggles an ambig

Anshuman Pattnaik 282 Jan 3, 2023
Detects request smuggling via HTTP/2 downgrades.

h2rs Detects request smuggling via HTTP/2 downgrades. Requirements Python 3.x Python Modules base64 sys socket ssl certifi h2.connection h2.events arg

Ricardo Iramar dos Santos 89 Dec 22, 2022
EasyRequests is a minimalistic HTTP-Request Library that wraps aiohttp and asyncio in a small package that allows for sequential, parallel or even single requests

EasyRequests EasyRequests is a minimalistic HTTP-Request Library that wraps aiohttp and asyncio in a small package that allows for sequential, paralle

Avi 1 Jan 27, 2022
Fast HTTP parser

httptools is a Python binding for the nodejs HTTP parser. The package is available on PyPI: pip install httptools. APIs httptools contains two classes

magicstack 1.1k Jan 7, 2023
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Paweł Piotr Przeradowski 8.6k Jan 4, 2023
Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.

Introduction httplib2 is a comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries. HTTP and HTTPS HTTP

null 457 Dec 10, 2022
A next generation HTTP client for Python. 🦋

HTTPX - A next-generation HTTP client for Python. HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support

Encode 9.8k Jan 5, 2023
Python requests like API built on top of Twisted's HTTP client.

treq: High-level Twisted HTTP Client API treq is an HTTP library inspired by requests but written on top of Twisted's Agents. It provides a simple, hi

Twisted Matrix Labs 553 Dec 18, 2022
Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more.

urllib3 is a powerful, user-friendly HTTP client for Python. Much of the Python ecosystem already uses urllib3 and you should too. urllib3 brings many

urllib3 3.2k Dec 29, 2022
Asynchronous HTTP client/server framework for asyncio and Python

Async http client/server framework Key Features Supports both client and server side of HTTP protocol. Supports both client and server Web-Sockets out

aio-libs 13.1k Jan 1, 2023
Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more.

urllib3 is a powerful, user-friendly HTTP client for Python. Much of the Python ecosystem already uses urllib3 and you should too. urllib3 brings many

urllib3 3.2k Jan 2, 2023
Asynchronous Python HTTP Requests for Humans using Futures

Asynchronous Python HTTP Requests for Humans Small add-on for the python requests http library. Makes use of python 3.2's concurrent.futures or the ba

Ross McFarland 2k Dec 30, 2022
HTTP/2 for Python.

Hyper: HTTP/2 Client for Python This project is no longer maintained! Please use an alternative, such as HTTPX or others. We will not publish further

Hyper 1k Dec 23, 2022
🔄 🌐 Handle thousands of HTTP requests, disk writes, and other I/O-bound tasks simultaneously with Python's quintessential async libraries.

?? ?? Handle thousands of HTTP requests, disk writes, and other I/O-bound tasks simultaneously with Python's quintessential async libraries.

Hackers and Slackers 15 Dec 12, 2022
A Python obfuscator using HTTP Requests and Hastebin.

?? Jawbreaker ?? Jawbreaker is a Python obfuscator written in Python3, using double encoding in base16, base32, base64, HTTP requests and a Hastebin-l

Billy 50 Sep 28, 2022
Aiosonic - lightweight Python asyncio http client

aiosonic - lightweight Python asyncio http client Very fast, lightweight Python asyncio http client Here is some documentation. There is a performance

Johanderson Mogollon 93 Jan 6, 2023
A simple, yet elegant HTTP library.

Requests Requests is a simple, yet elegant HTTP library. >>> import requests >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')

Python Software Foundation 48.8k Jan 5, 2023
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie

HTTPie: human-friendly CLI HTTP client for the API era HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI in

HTTPie 25.4k Jan 1, 2023
A minimal HTTP client. ⚙️

HTTP Core Do one thing, and do it well. The HTTP Core package provides a minimal low-level HTTP client, which does one thing only. Sending HTTP reques

Encode 306 Dec 27, 2022