-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): update dependency urllib to v3 (#187)
* chore(npm): update dependency urllib to v3 * fix: update urllib to v3 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: 3846masa <3846masahiro+git@gmail.com>
- Loading branch information
1 parent
b4096e7
commit f7f7332
Showing
6 changed files
with
120 additions
and
514 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
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http'; | ||
import { CookieAgent } from 'http-cookie-agent/undici'; | ||
import { CookieJar } from 'tough-cookie'; | ||
import urllib from 'urllib'; | ||
import { request, setGlobalDispatcher } from 'urllib'; | ||
|
||
const jar = new CookieJar(); | ||
const agent = new CookieAgent({ cookies: { jar } }); | ||
setGlobalDispatcher(agent); | ||
|
||
await urllib.request('https://httpbin.org/cookies/set/session/userid', { | ||
agent: new HttpCookieAgent({ cookies: { jar } }), | ||
httpsAgent: new HttpsCookieAgent({ cookies: { jar } }), | ||
}); | ||
await request('https://httpbin.org/cookies/set/session/userid'); | ||
|
||
const cookies = await jar.getCookies('https://httpbin.org'); | ||
console.log(cookies); |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.