JSPM

  • Created
  • Published
  • Downloads 1139377
  • Score
    100M100P100Q186617F
  • License MIT

Node Rest and Http Clients for use with TypeScript

Package Exports

  • typed-rest-client
  • typed-rest-client/HttpClient
  • typed-rest-client/RestClient
  • typed-rest-client/Util

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 (typed-rest-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Typed Rest and Http Client with TypeScript Typings

A lightweight Rest and Http Client optimized for use with TypeScript with generics and async await.

Status

With 0.9 just published, we believe the API surface for 1.0 has settled. More testing in progress then we will release 1.0.

Features

  • Rest Client with typescript generics and async/await/Promises

  • Http Client with pipe stream support and async/await/Promises

  • Typings included so no need to acquire separately (great for intellisense and no versioning drift)

  • Basic, Bearer and NTLM Support out of the box

  • Proxy support

  • Certificate support (Self-signed server and client cert)

  • Layered for Rest or Http use

  • Full Samples and Tests included for usage

import * as rm from 'typed-rest-client/RestClient';

let restc: rm.RestClient = new rm.RestClient('rest-samples', 
                                             'https://mystudentapiserver');

let res: rm.IRestResponse<Student> = await restc.get<Student>('/students/5');

console.log(res.statusCode);
console.log(res.result.name);

intellisense

Install the library

npm install typed-rest-client --save

Samples

See samples for complete coding examples

Contributing

To contribute to this repository, see the contribution guide

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.