【文件属性】:
文件名称:electron-main-fetch:使用Electron主要过程中的浏览器Fetch API
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-26 07:58:00
JavaScript
电子主取
使用Electron主要过程中的浏览器
安装
$ npm install electron-main-fetch
需要Electron 9或更高版本。
用法
const fetch = require ( 'electron-main-fetch' ) ;
( async ( ) => {
const response = await fetch ( 'https://api.ipify.org' ) ;
console . log ( await response . text ( ) ) ;
//=> '170.56.15.35'
} ) ( ) ;
原料药
提取(输入,选项)
与相同的
响应对象示例
{
type : 'cors' ,
url : 'https://api.ipify.org/' ,
redirected : false ,
statu
【文件预览】:
electron-main-fetch-main
----.gitignore(23B)
----package.json(870B)
----.npmrc(19B)
----index.js(4KB)
----test.js(3KB)
----.github()
--------workflows()
----license(1KB)
----example.js(1KB)
----readme.md(2KB)
----.gitattributes(19B)
----.editorconfig(175B)