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);
},
});
})();
-
Notifications
You must be signed in to change notification settings - Fork 0
iamfat/fetch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
@genee/fetch source
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published