←back to thread

923 points zh2408 | 8 comments | | HN request time: 1.29s | source | bottom
1. istjohn ◴[] No.43743958[source]
This is neat, but I did find an error in the output pretty quickly. (Disregard the mangled indentation)

  # Use the Session as a context manager
  with requests.Session() as s: 
   
 s.get('https://httpbin.org/cookies/set/contextcookie/abc')
      response = s.get(url) # ???
      print("Cookies sent within 'with' block:", response.json())
https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Req...
replies(2): >>43744024 #>>43744100 #
2. zh2408 ◴[] No.43744024[source]
This code creates an HTTP session, sets a cookie within that session, makes another request that automatically includes the cookie, and then prints the response showing the cookies that were sent.

I may miss the error, but could you elaborate where it is?

replies(2): >>43744049 #>>43744085 #
3. ◴[] No.43744049[source]
4. Armazon ◴[] No.43744085[source]
The url variable is never defined
replies(1): >>43744096 #
5. foobarbecue ◴[] No.43744096{3}[source]
Yes it is, just before the pasted section.
replies(1): >>43744145 #
6. totally ◴[] No.43744100[source]
If only the AI could explain the errors that the AI outputs.
replies(1): >>43748861 #
7. Armazon ◴[] No.43744145{4}[source]
oh you are right, nevermind then
8. ForOldHack ◴[] No.43748861[source]
Cannot you stuff the snakes tail into its mouth?

I tried this for some very small decompilation projects, and it was cute at best.

Then I sent it a boot loader. I should have posted it on a ceral box for better results.

Is someone going to suggest that I check the dissembly into git hub and watch it make a tutorial?