معرفی شرکت ها


arequest-0.2.9


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

arequest is an async HTTP client for Python, with more customization.
ویژگی مقدار
سیستم عامل -
نام فایل arequest-0.2.9
نام arequest
نسخه کتابخانه 0.2.9
نگهدارنده []
ایمیل نگهدارنده []
نویسنده p7e4
ایمیل نویسنده p7e4@qq.com
آدرس صفحه اصلی https://github.com/p7e4/arequest
آدرس اینترنتی https://pypi.org/project/arequest/
مجوز Apache 2.0
# arequest ![PyPI](https://img.shields.io/pypi/v/arequest) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/arequest) ![Downloads](https://pepy.tech/badge/arequest) ![PyPI - License](https://img.shields.io/pypi/l/arequest) _arequest is an async HTTP client for Python, with more customization._ ## Warnning **The arequest is experimental for now, please do not use for production environment.** ## Installation `pip install arequest` > *python3.8 or higher version is required.* ## Quickstart It's requests-like, just don't forget `async/await`. ``` python import asyncio import arequest async def main(): r = await arequest.get("https://httpbin.org/get") print(r.headers) print(r.status_code) print(r.encoding) print(r.text) asyncio.run(main()) ``` ## Request ### Passing Parameters In URLs ``` python await arequest.get("https://httpbin.org/get", params={"key": "value"}) ``` ### POST ``` python await arequest.post("https://httpbin.org/post", data={"key": "value"}) ``` - POST JSON ``` python await arequest.post("https://httpbin.org/post", json={"key": "value"}) ``` ### Reuse a connection ``` python async with arequest.Session() as session: await session.get("https://httpbin.org/get") await session.get("https://httpbin.org/get") ... ``` > *unlike `requests.Session()`, it does not automatically handle `Set-Cookie`* ### Custom Headers ``` python headers = { "user-agent": "test" } await arequest.get("https://httpbin.org/get", headers=headers) ``` if you want to set header `Content-Type`, use `contentType`. ``` python await arequest.post("https://httpbin.org/post", contentType="application/test") ``` ### Custom cookies ``` python await arequest.get("https://httpbin.org/cookies", cookies={"key": "value"}) ``` ### Unverified SSL Cert ``` python await arequest.get("https://httpbin.org/get", verify=False) ``` ### Retry ``` python await arequest.get("https://httpbin.org/get", retries=1) ``` max retries, default `0` ### Timeout ``` python try: await arequest.get("http://httpbin.org/delay/5", timeout=3) except arequest.TimeoutError: print("timeout") ``` if timeout is `None`, wait until the request complete. default `30`s ## Response ```python print(r.headers) print(r.status_code) print(r.encoding) print(r.text) print(r.json()) ``` ### Binary Response Content ``` python r.content ``` ### Cookies ``` python r.cookies ``` ## TODO - [x] timeout - [ ] file upload - [ ] proxy - [x] keep-alive - [ ] http2 - [ ] raw request - [x] cookies handle - [x] response cookies - [ ] test coverage


نیازمندی

مقدار نام
- chardet
- h11


زبان مورد نیاز

مقدار نام
>=3.8 Python


نحوه نصب


نصب پکیج whl arequest-0.2.9:

    pip install arequest-0.2.9.whl


نصب پکیج tar.gz arequest-0.2.9:

    pip install arequest-0.2.9.tar.gz