http-service-lib
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Http Service Lib

Presenting a reusable http library to Node.Js. This library uses well defined http client solutions to deliver scalable and reusable http services.

Simple usage to perform JSON request

import { apiURL } from 'consts';
import { HttpPostService, HttpError, HttpJSONRequest } from 'http-service-lib';

async function login({ email, password }: { email: string; password: string }) {
	const data = await this.httpPostService.post<{ accessToken: string }>(
		new HttpJSONRequest(
			`${apiURL}/users/sessions`,
			{
				Authorization: 'Basic 123',
			},
			{
				email,
				password,
			}
		)
	);
	return data.body;
}

Readme

Keywords

Package Sidebar

Install

npm i http-service-lib

Weekly Downloads

0

Version

1.3.0

License

ISC

Unpacked Size

20.2 kB

Total Files

44

Last publish

Collaborators

  • josemorista