MCPcopy
hub / github.com/axios/axios / generateHTTPMethod

Function generateHTTPMethod

lib/core/Axios.js:257–272  ·  view source on GitHub ↗
(isForm)

Source from the content-addressed store, hash-verified

255
256utils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
257 function generateHTTPMethod(isForm) {
258 return function httpMethod(url, data, config) {
259 return this.request(
260 mergeConfig(config || {}, {
261 method,
262 headers: isForm
263 ? {
264 'Content-Type': 'multipart/form-data',
265 }
266 : {},
267 url,
268 data,
269 })
270 );
271 };
272 }
273
274 Axios.prototype[method] = generateHTTPMethod();
275

Callers 1

Axios.jsFile · 0.85

Calls 2

mergeConfigFunction · 0.85
requestMethod · 0.80

Tested by

no test coverage detected