1.2.6 • Published 4 years ago

@feizheng/next-node-fetch v1.2.6

Weekly downloads
17
License
MIT
Repository
-
Last release
4 years ago

next-node-fetch

A wrapper for node-fetch.

installation

npm install -S @feizheng/next-node-fetch

apis

apiparamsdescription
request(inUrl, inMethod, inData, inOptions)The entry api
get(inUrl, inData, inOptions)The get api
post(inUrl, inData, inOptions)The post api
delete(inUrl, inData, inOptions)The delete api
put(inUrl, inData, inOptions)The put api
head(inUrl, inData, inOptions)The head api
patch(inUrl, inData, inOptions)The patch api

options

optiontypedefaultdescription
fetchFunctionrequire('node-fetch')Defult fetch implement
dataTypeStringjsonjson/raw/urlencoded/multipart
delayNumber0The every request delay timer(ms)
responseTypeString/Nulljsonjson/text/null

usage

import NxNodeFetch from '@feizheng/next-node-fetch';

NxNodeFetch.get('https://api.github.com/users/afeiship', null, { responseType:'json' }).then(res=>{
  console.log(res);
});

// {
//   login: 'afeiship',
//   id: 3038631,
//   node_id: 'MDQ6VXNlcjMwMzg2MzE=',
//   avatar_url: 'https://avatars2.githubusercontent.com/u/3038631?v=4',
    // .....
// }

resources

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago