node-modules / urllib

Request HTTP(s) URLs in a complex world.
MIT License
725 stars 115 forks source link

What kind of cookie support is there? #463

Closed tremby closed 11 months ago

tremby commented 12 months ago

In the readme the package is described:

Request HTTP URLs in a complex world — basic and digest authentication, redirections, cookies, timeout and more.

I see nothing further about cookies in the readme, however, and nothing in the examples. There's also very little in a code search.

I'm guessing the support is just whatever undici offers; is that correct?

What I'm looking for in particular is a way to maintain a "cookie jar" for a given session; I'm communicating with a very outdated API. I'm trying to find out if this is something I need to implement myself by handling response headers and adding request headers, or if there's an existing feature for it.

fengmk2 commented 12 months ago

Yes, urllib, like unidici, only handles the http request itself, the management of cookies needs to be managed by the user, and the maintenance of cookie state data is not part of the http protocol, so urllib doesn't have this capability built in.

tremby commented 12 months ago

OK, thanks. I suggest removing the part about cookies from the readme, in that case.