mithril-requests

1.1.0 • Public • Published

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')
 
= 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.

Package Sidebar

Install

npm i mithril-requests

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • nijikokun