MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / Request

Function Request

scripts/libs/fetch.js:203–217  ·  view source on GitHub ↗
(url, options)

Source from the content-addressed store, hash-verified

201 }
202
203 function Request(url, options) {
204 options = options || {}
205 this.url = url
206
207 this.credentials = options.credentials || 'omit'
208 this.headers = new Headers(options.headers)
209 this.method = normalizeMethod(options.method || 'GET')
210 this.mode = options.mode || null
211 this.referrer = null
212
213 if ((this.method === 'GET' || this.method === 'HEAD') && options.body) {
214 throw new TypeError('Body not allowed for GET or HEAD requests')
215 }
216 this._initBody(options.body)
217 }
218
219 function decode(body) {
220 var form = new FormData()

Callers

nothing calls this directly

Calls 1

normalizeMethodFunction · 0.85

Tested by

no test coverage detected