setu.js
Version:
A lightweight HTTP client for Node.js and the browser, with smart adapter selection.
19 lines • 515 B
JavaScript
import { coreRequest } from '../nodeAdapter.js';
import { defaults } from '../defaults.js';
const method = (m) => {
return (url, config) => coreRequest(url, { ...config, method: m });
};
const setu = {
get: method('GET'),
post: method('POST'),
put: method('PUT'),
patch: method('PATCH'),
delete: method('DELETE'),
defaults
};
const client = ((url, config) => {
return coreRequest(url, config);
});
Object.assign(client, setu);
export default client;
//# sourceMappingURL=index.js.map