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-1.0.0.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-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file haso_api_client-1.0.0.tar.gz.

File metadata

  • Download URL: haso_api_client-1.0.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 04c2561adcaf40ea4858e1c1e1b0a59370dbaea235b2fcc99ddd47a063f7dd06
MD5 10d0a08bcb84042af04736d4b6be26e3
BLAKE2b-256 1d89fd9a849ad34908f1e927c921d3f13f420b72216bac40081f346aa62b2dee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for haso_api_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9bb6f445ad707dfc99004f2e5e95791eee7b65727c135e65d1826f8b55b38c
MD5 1091318397bc1896d19d0922d5e6e9ff
BLAKE2b-256 b9c48009787e6ebcf1c0aeaadc4ca5e96d946d1a40edfa0356ff7f07d34985fb

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