8000 GitHub - iamfat/fetch: @genee/fetch source
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

iamfat/fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@genee/fetch

Usage

import fetch from '@genee/fetch';

type UserData = {
    id: number;
    name: string;
};

(async () => {
    const user = await fetch<UserData>('path/to/user', {
        method: 'POST',
        body: {
            name: 'Doe John',
        },
        // timeout: 5000,   // default is 5000
        // json: true,      // default is true, return original text if json is false
        beforeRequest(url, init) {
        
        },
        customParser(r: Response, defaultParser: (r: Response) => any) {
            return defaultParser(r);
        },
    });
})();

About

@genee/fetch source

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0