fetch
see Response.
Sends a request, similarly to how fetch()
works in the renderer, using Chrome's network stack. This differs from Node's fetch()
, which uses Node.js's HTTP stack.
Example:
This method will issue requests from the default session. To send a fetch
request from another session, use ses.fetch().
See the MDN documentation for fetch()
for more details.
Limitations:
net.fetch()
does not support thedata:
orblob:
schemes.The value of the
integrity
option is ignored.The
.type
and.url
values of the returnedResponse
object are incorrect.
By default, requests made with net.fetch
can be made to custom protocols as well as file:
, and will trigger webRequest handlers if present. When the non-standard bypassCustomProtocolHandlers
option is set in RequestInit, custom protocol handlers will not be called for this request. This allows forwarding an intercepted request to the built-in handler. webRequest handlers will still be triggered when bypassing custom protocols.
Note: in the utility process custom protocols are not supported.