```coffeescript
Q = require 'q'

class NCN
  constructor: (@host = '') -> return
  request = (method, url, data) ->
    deferred = Q.defer()
    x = new XMLHttpRequest()
    x.responseType = 'json'
    x.addEventListener 'load', () -> deferred.resolve x.response
    x.addEventListener 'error', () -> deferred.reject x
    x.open('method', host + path)
    x.send(JSON.stringify(data))
    deferred.promise
  get: (path, data) ->
    buildParam = (prefix, obj) ->
      for key, value of data
        if _.isObject obj
        then buildParam(key + '.', value)
        else encodeURIComponent(prefix + key) + '=' + encodeURIComponent(value)
    _.fltten(buildParam('', data)).join('&')
    prefix = if _.contains(path '?') then '?' else ':'
    request('GET', @host + path + prefix + qs)
  post: (path, data) -> request('POST', @host + path, data)
  del: (path, data) -> request('DELETE', @host + path)
  put: (path, data) -> request('PUT', @host + path)


exports = NCN
```

Use jquery to send ajax request
user
```coffeescript
Bacon = require 'bacon'
$ = require 'jquery'

class NCN
  constructor: (@host = '') ->
  request = (method) -> (path, data) ->
    Bacon.fromPromise(
      $.ajax @host + path,
        data: data
        type: method
        dataType: 'json')
  get: request 'GET'
  post: request 'POST'
  delete: request 'DELETE'
  put: request 'PUT'

module.exports = NCN
```
assistant