sugo-agent-base
Base class of HTTP clients for SUGOS
Last updated 10 months ago by realglobe .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install sugo-agent-base 
SYNC missed versions from official npm registry.

sugo-agent-base

Build Status npm Version JS Standard

Base class of HTTP clients for SUGOS

Installation

$ npm install sugo-agent-base --save

Usage

'use strict'

const { SugoAgentBase } = require('sugo-agent-base')
const co = require('co')

class YourCustomAgent extends SugoAgentBase() {
  constructor (url, options = {}) {
    super(url, options)
    /* ... */
  }

  doSomething (/* ... */) {
    const s = this
    let { request, url } = s
    return co(function * () {
      let { statusCode, body } = request.post(`${url}/hoge`, {
        data: {}
      })
      /* ... */
    })
  }
}

let agent = new YourCustomAgent()
/* ... */

License

This software is released under the MIT License.

Links

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)

Copyright 2014 - 2017 © taobao.org |