Skip to main content

A simple HTTP/S client for Python written in rust

Project description

requests_rust

HTTP/s requests for python with rust

Description

it's a POC for a library in Python that sends requests and gets JSON responses written in Rust.

it's a public repo, exist on pypi.

Features

  • written in rust
  • only works for sending and receiving JSON requests
  • always returns a JSON, no need to convert by using the JSON method
  • it's a POC

Installation

  1. by running pip install requests-rust
  2. download from actions artifacts latest one
  3. clone it and build using maturin (cargo)

Usage

By default, it returns JSON, if the server doesn't respond the status code will be 0.

send_request(METHOD, URL, [Optional]TIMEOUT, [Optional]DATA(as dict))
from http_requests import send_request
res = send_request('GET', 'http://127.0.0.1:3000/')
print(res)

it supports these methods: GET, POST, PATCH, PUT, DELETE, HEAD

  • if call it with not define method it returns None
from http_requests import send_request
res = send_request('TEST', 'http://127.0.0.1:3000/')
print(res)

output: None

Contributing

Contributions are welcome! Please follow the guidelines in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Contact

For any questions or feedback, please reach out to hamid@darabi.website.

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

requests_rust-0.1.2.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distributions

requests_rust-0.1.2-cp312-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

requests_rust-0.1.2-cp312-none-win32.whl (1.1 MB view hashes)

Uploaded CPython 3.12 Windows x86

requests_rust-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

requests_rust-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

requests_rust-0.1.2-cp311-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

requests_rust-0.1.2-cp311-none-win32.whl (1.1 MB view hashes)

Uploaded CPython 3.11 Windows x86

requests_rust-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

requests_rust-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

requests_rust-0.1.2-cp311-cp311-macosx_10_12_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

requests_rust-0.1.2-cp310-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

requests_rust-0.1.2-cp310-none-win32.whl (1.1 MB view hashes)

Uploaded CPython 3.10 Windows x86

requests_rust-0.1.2-cp39-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

requests_rust-0.1.2-cp39-none-win32.whl (1.1 MB view hashes)

Uploaded CPython 3.9 Windows x86

requests_rust-0.1.2-cp38-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

requests_rust-0.1.2-cp38-none-win32.whl (1.1 MB view hashes)

Uploaded CPython 3.8 Windows x86

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