mithril-global-request-headers

0.0.3 • Public • Published

mithril-global-request-headers

A simple (POC) module for adding global http headers support to m.request.

Eg

Init

require('mithril-global-request-headers')(m)

Add a header

require('mithril-global-request-headers')(m)

m.addGlobalHeader('authorization', 'key...')

Remove headers

require('mithril-global-request-headers')(m)

m.addGlobalHeader('authorization', 'key...')
m.removeGlobalHeader('authorization', 'key...') // Remove exact

m.addGlobalHeader('authorization', 'key...')
m.removeGlobalHeader('authorization') // Remove based on key match

Access all configured headers

require('mithril-global-request-headers')(m)

m.getGlobalHeaders()

Don't add global headers to a single request

require('mithril-global-request-headers')(m)

m.request({ disableGlobalHeaders: true, ... })

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i mithril-global-request-headers

Weekly Downloads

0

Version

0.0.3

License

ISC

Last publish

Collaborators

  • bryce-gibson