JSPM

@fosenu/httpclient

0.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26597F
  • License MIT

A HTTP-client written in typescript, using native node.js library

Package Exports

  • @fosenu/httpclient

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fosenu/httpclient) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@fu/httpclient

Build Status

HTTP Client for node.js, using node.js own http and https library. Zero dependencies!

Getting Started

npm install @fu/httpclient

Installing

To setup your own development environment:

Install dev-dependencies

npm install --dev

Run tests

npm test

Deployment

To use in your own project

import {Client} from '@fu/httpclient';
const client = new Client('localhost', {
    port: 80
});

const response = await client.get('/hello-world');

new Client(hostname, options)

Available options

- `baseUrl` - hostname, uses the hostname parameter from the constructor
- `protocol` - http or https
- `encoding` - Character encoding 
- `port` - Port to use for hostname, default 80 for http, 443 for https
- `error` - Function to call when an error occurs
- `headers` - HTTP headers for all requests

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details