@healthcloudai/hc-http
v0.0.3
Published
Reusable HTTP client layer with axios and TypeScript for modular SDKs
Maintainers
Readme
Healthcheck Http Connector
This library provides a shared HTTP layer for Healthcheck API connectors, usable from TypeScript or JavaScript.
Features:
- Shared HttpClient abstraction
- Fetch-based HTTP client
- Axios-based HTTP client
- Common HTTP and configuration error handling
Installation
npm install @halthcloudai/hc-http
Import
import { FetchClient, AxiosClient, HttpClient } from "@halthcloudai/hc-http";
Usage
Configuration
import { FetchClient } from "@halthcloudai/hc-http";
const http = new FetchClient();
GET Request
await http.get(
"https://api.example.com/resource",
{
Authorization: "Bearer token"
}
);
POST Request
await http.post(
"https://api.example.com/resource",
{ key: "value" },
{
"Content-Type": "application/json"
}
);
PUT Request
await http.put(
"https://api.example.com/resource",
{ key: "updated-value" },
{
"Content-Type": "application/json"
}
);