-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,7 @@ const net = ftch(fetch, { | |
timeout: 5000, | ||
concurrencyLimit: 10, | ||
}); | ||
const result = await net('https://example.com'); | ||
|
||
net('https://user:[email protected]/basic-auth/user/pwd'); // Basic auth | ||
const res = await net('https://example.com'); | ||
|
||
// Composable | ||
const rpc = jsonrpc(net, 'http://rpc_node/', { | ||
|
@@ -32,8 +30,9 @@ const rpc = jsonrpc(net, 'http://rpc_node/', { | |
}); | ||
const res1 = await rpc.call('method', 'arg0', 'arg1'); | ||
const res2 = await rpc.callNamed('method', { arg0: '0', arg1: '1' }); // named arguments | ||
|
||
const testRpc = replayable(rpc); | ||
// Basic auth auto-parsing | ||
await net('https://user:[email protected]/basic-auth/user/pwd'); | ||
``` | ||
|
||
- [ftch](#ftch) | ||
|