1.1.0 • Published 7 years ago

fluent-http v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

npm version Build Status js-standard-style ncloc coverage sqale_debt_ratio

fluent-http

Usage

npm install fluent-http

Script tag

// HTML
<script src="node_modules/fluent-http/dist/fluent-http.js"></script>

// JS
window.fluentHttp

CommonJS

const fluentHttp = require('fluent-http')

ES6 import

import { Http } from 'fluent-http'

Examples

const client = new fluentHttp.Http()

client.withUrl('https://google.com')
.request()
.then((response) => {
  console.log(response)
})
class BasicAuthInterceptor extends fluentHttp.Interceptor { ... }

const client = new fluentHttp.Http()

client.asPost()
.withUrl('/api/create')
.withInterceptor(new BasicAuthInterceptor(user, pass))
.withData(fluentHttp.Body.asJson(someData))
.request()
.then((response) => {
  console.log(response)
})

Development

Tests

Links of interest

1.1.0

7 years ago

1.0.0

7 years ago