fetchclient:使用fetch api发出HTTP请求的实用程序类

时间:2021-02-13 20:24:03
【文件属性】:
文件名称:fetchclient:使用fetch api发出HTTP请求的实用程序类
文件大小:71KB
文件格式:ZIP
更新时间:2021-02-13 20:24:03
TypeScript 实用程序类,可使用提取API发出HTTP请求 用法 // Instantiate object const fc = new FetchClient ( { baseUri : "http://example.api" , headers : { Authorization : "" , } , } ) ; // Sample GET request const fc : FetchClient = new FetchClient ( /*{opts}*/ ) ; const res = await fc . get ( "/comments" ) ; const resBody = await fc . json ( res ) ; console . log ( resBody ) ; // Sample POST request const fc
【文件预览】:
fetchclient-main
----package.json(968B)
----jest.config.js(994B)
----dist()
--------index.js(689B)
--------index.d.ts(64B)
--------lib()
----src()
--------__tests__()
--------lib()
--------index.ts(64B)
----tsconfig.json(6KB)
----.gitignore(27B)
----README.md(1KB)
----yarn.lock(154KB)

网友评论