"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.post = post;
exports.get = get;

var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const headers = {
  Accept: 'application/json',
  'Content-Type': 'application/json; charset=utf-8',
  OPTIONS: ''
};

function post(url, data) {
  return (0, _isomorphicFetch.default)(url, {
    method: 'POST',
    headers,
    body: JSON.stringify(data)
  }).then(response => response);
}

function get(url) {
  return (0, _isomorphicFetch.default)(url, {
    method: 'GET',
    headers
  }).then(response => response.json());
}