1.1.0 • Published 9 years ago

mithril-requests v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

Mithril Requests

Creates sugar http methods for Mithril.js existing request library

version License Build Status Downloads Code Climate Coverage Status Dependencies

Install

Setup

var m = require('mithril')
var requests = require('mithril-requests')

m = requests(m)

Documentation

m.request.verb(url, options)

Sugar method to invoke an XHR request on the underlying m.request method, fully supporting all options with no difference in api other than seperating out the url and method values.

Example

m.request.get('mockbin.com/request').then(function (value) {
  console.log(value)
})

Verbs

This is an array of lowercased method names that are supported.

  • get
  • post
  • put
  • head
  • delete
  • options
  • trace
  • copy
  • lock
  • mkcol
  • move
  • purge
  • propfind
  • proppatch
  • unlock
  • report
  • mkactivity
  • checkout
  • merge
  • notify
  • subscribe
  • unsubscribe
  • patch
  • search
  • connect

License

Licensed under The MIT License.