Skip to main content

A simple API client package.

Project description

Haso API Client

Haso API Client is a Python package for making HTTP requests to web APIs. It provides a simple interface for sending GET, POST, PUT, and DELETE requests, handling query parameters and request bodies, and parsing JSON responses. API Client is designed to be easy to use and to integrate with any Python project.

Installation

Haso API Client can be installed using pip:

pip install haso_api_client

Usage

Here's an example of how to use Haso API Client to make a GET request:

import haso_api_client

base_url = "https://jsonplaceholder.typicode.com"

client=haso_api_client.APIClient(base_url=base_url)

response, status_code, headers = client.get("/posts/1")

API Client also supports POST, PUT, and DELETE requests:

# POST request
data = {"userId": 1, "id": 101, "title": "test title", "body": "test body"}
response, status_code, headers = client.post(path="/posts", data=data)

# PUT request
data = {"userId": 1, "id": 1, "title": "test title", "body": "test body"}
response, status_code, headers = client.put(path="/posts/1", data=data)

# DELETE request
response, status_code, _ = client.delete("/posts/1")

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Haseb-ali/api_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

API Client is released under the MIT 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

haso-api-client-0.1.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haso_api_client-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file haso-api-client-0.1.1.tar.gz.

File metadata

  • Download URL: haso-api-client-0.1.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.4

File hashes

Hashes for haso-api-client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6adf09371ccf57ee5a280266c9fcd3c09be2d85fe27a3d9c118a4637a6fcfc14
MD5 49049ba9231fe9a8c0f0231eb686cf14
BLAKE2b-256 8e5f2811f6640fc71967ad773d4308482f2225eec40f3fd6f686ec605094478f

See more details on using hashes here.

File details

Details for the file haso_api_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for haso_api_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd6fec99fe8042a41d55a9280bfc683a9937c70781f97638e319fe8d9d1104ae
MD5 653ed673198998e42afb381c576a84ae
BLAKE2b-256 512bdbcb3f98fd9264543d4fcedf8a1f54e6c930a9345fe1031e3c8a76a62598

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