conjure-typescript-client
A light-weight Promise based HTTP client library for the browser.
Overview
conjure-typescript-client leverages fetch to provide a
simple interface for making HTTP requests. conjure-typescript-client was designed to handle the RPC layer for
clients generated by Conjure-TypeScript.
Browser compatibility: This library uses fetch so you should ensure that your runtime environment supports ES6 features.
Example
import { DefaultHttpApiBridge, MediaType } from "conjure-client";
import { SomeService } from "some-conjure-api";
const bridge = new DefaultHttpApiBridge({
baseUrl: "https://some.base.url.com",
userAgent: {
productName: "yourProductName",
productVersion: "1.0.0"
}
})
const service = new SomeService(bridge);
service.getSomeResult()
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
.then(function () {
});
Contributing
See the CONTRIBUTING.md document.