ehttp icon indicating copy to clipboard operation
ehttp copied to clipboard

Documentation for HTTPS Request with cookie?

Open rustrust opened this issue 3 years ago • 5 comments

Would it be possible to get some documentation on how to connect ehttp to perform https requests submitted with cookies, and how those cookies can be set via the response? Thanks!

rustrust avatar Nov 01 '22 21:11 rustrust

I think adding docs for that would be great. Would you like to help out?

ehttp is a very thin wrapper around ureq and web_sys::Request, so it should be pretty easy to figure out!

emilk avatar Feb 28 '23 19:02 emilk

Would it be possible to have cookies as a first-class feature in ehttp?

rustrust avatar Oct 05 '23 18:10 rustrust

For reference: cookies can be accessed within response.headers.

I'm not sure what you mean by "first class" ? I'm guessing either:

  • Some way to more easily retrieving cookie values from a single request (from response.headers), I'm not sure how much simpler it would be compared to bringing another dependency to parse the cookie (I guess https://docs.rs/cookie/latest/cookie/ ?)
  • Automatic retrieving of cookies, storing and sending them again, I'm not the maintainer, but I think it's quite complex to add, and likely to fit better in another library wrapping around ehttp:
    • Where do you store the cookie ? in memory ? in a file ?
    • secure cookie (http only) are a thing, how should they be handled.
    • expiry handling
    • Probably other things I did not think about.

ThierryBerger avatar Nov 16 '23 09:11 ThierryBerger

I see set-cookie in the response headers when visiting common websites.

Yes I am asking about proper overall handling of the cookie including storage for both native and wasm egui applications, including storage. If I would need to make my own decisions about cookie storage, some guidance would be useful...

rustrust avatar Dec 07 '23 00:12 rustrust