Closed DjakaTechnology closed 1 year ago
Hi, thanks for reaching out!
At first glance it looks like the problem is that you never send the request you built. Once you build the request using body(())
, you need to send the request using send
. Attaching a cookie jar using cookie_jar
will not immediately apply a Cookie
header to the request object, it just associates the cookie jar with the request. You have to send the request for the Isahc cookie engine to take any action.
If you want to see the actual headers that get sent in a request I recommend you hook up a log-compatible logger (such as env_logger) and enable trace logs for the isahc::wire
log target. Isahc will log the actual headers that get written to the network there. Debug-printing the Request
object will only show headers that you've explicitly supplied to the request object. The request object is just a plain old data structure, it doesn't contain any actual logic (until you send it).
Hope that helps!
Ahh i see, my bad then. Thank you!
Hello, i'm trying to get cookie working but somehow the cookie never sent in the header, but somehow it never sent in the request.
Weirdly, when we get via ISHAC_COOKIE_JAR.get_for_uri(&Uri::from_str(url) it managed to return the cookie. Is there missing config in my code?
Thanks
Log: