Add RequestBuilder::fetch_mode_no_cors()

This commit is contained in:
rhysd
2020-01-06 12:54:24 +09:00
committed by Sean McArthur
parent 22fe6566ff
commit 6004623784
4 changed files with 37 additions and 0 deletions

View File

@@ -353,6 +353,19 @@ impl RequestBuilder {
self
}
/// Disable CORS on fetching the request.
///
/// # WASM
///
/// This option is only effective with WebAssembly target.
///
/// The [request mode][mdn] will be set to 'no-cors'.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
pub fn fetch_mode_no_cors(self) -> RequestBuilder {
self
}
/// Build a `Request`, which can be inspected, modified and executed with
/// `Client::execute()`.
pub fn build(self) -> crate::Result<Request> {