From ba742ea5baa8839564623b85e03dcdbf67b2745b Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Tue, 8 Oct 2024 15:05:00 +1100 Subject: [PATCH] RequestInit / Request() updates --- files/en-us/web/api/request/request/index.md | 28 +++----------------- files/en-us/web/api/requestinit/index.md | 3 ++- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/files/en-us/web/api/request/request/index.md b/files/en-us/web/api/request/request/index.md index 936c506403271ff..6496c330f65ed3b 100644 --- a/files/en-us/web/api/request/request/index.md +++ b/files/en-us/web/api/request/request/index.md @@ -54,33 +54,13 @@ new Request(input, options) ### Exceptions - - - - - - - - - - - - - -
TypeDescription
TypeError - Since Firefox 43, - Request() will throw a TypeError if the URL has - credentials, such as http://user:password@example.com. -
+- `TypeError` + - The URL has credentials, such as `http://user:password@example.com` or cannot be parsed. ## Examples -In our [Fetch Request example](https://github.com/mdn/dom-examples/tree/main/fetch/fetch-request) (see [Fetch Request live](https://mdn.github.io/dom-examples/fetch/fetch-request/)) we -create a new `Request` object using the constructor, then fetch it using a -{{domxref("Window/fetch", "fetch()")}} call. Since we are fetching an image, we run -{{domxref("Response.blob")}} on the response to give it the proper MIME type so it will be -handled properly, then create an Object URL of it and display it in an -{{htmlelement("img")}} element. +In our [Fetch Request example](https://github.com/mdn/dom-examples/tree/main/fetch/fetch-request) (see [Fetch Request live](https://mdn.github.io/dom-examples/fetch/fetch-request/)) we create a new `Request` object using the constructor, then fetch it using a {{domxref("Window/fetch", "fetch()")}} call. +Since we are fetching an image, we run {{domxref("Response.blob")}} on the response to give it the proper MIME type so it will be handled properly, then create an Object URL of it and display it in an {{htmlelement("img")}} element. ```js const myImage = document.querySelector("img"); diff --git a/files/en-us/web/api/requestinit/index.md b/files/en-us/web/api/requestinit/index.md index 70ba65ed8d8d36e..95e168f52e48bb5 100644 --- a/files/en-us/web/api/requestinit/index.md +++ b/files/en-us/web/api/requestinit/index.md @@ -169,7 +169,8 @@ You can also construct a `Request` with a `RequestInit`, and pass the `Request` - `low` - : A low priority fetch request relative to other requests of the same type. - `auto` - - : Automatically determine the priority of the fetch request relative to other requests of the same type. + - : No user preference for the fetch priority. + It is used if no value is set or if an invalid value is set. Defaults to `auto`.