Registered as js-data-http
in NPM and Bower. The build of js-data-http
that works on Node.js is registered in NPM as js-data-http-node
. The build
of js-data-http
that does not bundle axios
is registered in NPM and Bower
as js-data-fetch
.
Script tag:
window.HttpAdapter
CommonJS:
var HttpAdapter = require('js-data-http')
ES6 Modules:
import HttpAdapter from 'js-data-http'
AMD:
define('myApp', ['js-data-http'], function (HttpAdapter) { ... })
- Source:
Members
-
<static> HttpAdapter
-
- Source:
- See:
-
<static> version :Object
-
Details of the current version of the
js-data-http
module.Type:
- Object
- Source:
Properties:
Name Type Description version.full
string The full semver value.
version.major
number The major version number.
version.minor
number The minor version number.
version.patch
number The patch version number.
version.alpha
string | boolean The alpha version value, otherwise
false
if the current version is not alpha.version.beta
string | boolean The beta version value, otherwise
false
if the current version is not beta.
Methods
-
<static> addAction(name, opts)
-
Add an Http actions to a mapper.
Parameters:
Name Type Argument Description name
string Name of the new action.
opts
Object <optional>
Action configuration
Properties
Name Type Argument Description adapter
string <optional>
pathname
string <optional>
request
function <optional>
response
function <optional>
responseError
function <optional>
- Source:
Returns:
Decoration function, which should be passed the mapper to decorate when invoked.
- Type
- function
-
<static> addActions(opts)
-
Add multiple Http actions to a mapper. See HttpAdapter.addAction for action configuration options.
Parameters:
Name Type Description opts
Object.<string, Object> Object where the key is an action name and the value is the configuration for the action.
- Source:
Returns:
Decoration function, which should be passed the mapper to decorate when invoked.
- Type
- function