octoblu-request-formatter
Disclaimer: this is awesome, you want this
Last updated 4 years ago by octoblu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install octoblu-request-formatter 
SYNC missed versions from official npm registry.

Octoblu Request Formatter

Disclaimer: this is awesome, you want this

Pseudo example

crappy example payload

{
 "endpoint": "Add User",
 "params": {
     "attributes": "dfsf",
     "groups": "blarg"
 }
OctobluRequestFormatter = require 'octoblu-request-formatter'
format                  = new OctobluRequestFormatter(channelJson)

onMessage: (message) =>
  @defaultUrlParams = {
  ':hostname': @options.host
  ':port': @options.port
  }
  @auth = {
    'username': @options.username
    'password': @options.password
  }

  requestParams = format.processMessage message.payload, @auth, @defaultUrlParams
  request requestParams, (error, response, body) ->
    # have fun!

example response

{
  Accept: 'application/json',
    'User-Agent': 'Octoblu/1.0.0',
    'x-li-format': 'json' },
  uri: 'fdfd.com:80/xenmobile/api/v1/localusersgroups/Bob',
  method: 'GET',
  followAllRedirects: true,
  qs: {},
  strictSSL: false,
  form: {}
}

Current Tags

  • 0.1.8                                ...           latest (4 years ago)

9 Versions

  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |