UNPKG

fractal-devour-client

Version:

A lightweight, framework agnostic, flexible JSON API client

18 lines (15 loc) 614 B
'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; module.exports = { name: 'GET', req: function req(payload) { if (payload.req.method === 'GET') { payload.req.headers = _extends({}, payload.req.headers, { 'Content-Type': 'application/vnd.api+json', 'Accept': 'application/vnd.api+json' }); delete payload.req.data; } return payload; } };