sugo-agent-base
v1.2.12
Published
Base class of HTTP clients for SUGOS
Downloads
3
Readme
sugo-agent-base
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.