adafruit / Adafruit_CircuitPython_Requests

Requests-like interface for web interfacing
MIT License
51 stars 37 forks source link

Please re-work examples to not use deprecated `set_socket` #128

Closed jepler closed 7 months ago

hauserkristof commented 1 year ago

Hey @jepler !

Can you help me please, that what is the current correct usage instead of set_socket ?

Thank you!

jepler commented 1 year ago

Roughly, instead of

import adafruit_requests as requests
requests.set_socket(...)
requests.get(...)

the new structure is

import adafruit_requests
requests = adafruit_requests.Session(...)
requests.get(...)

however, I'm not sure that this will actually work for esp32spi-based boards ("airlift"). I've asked @FoamyGuy via discord about it.

toxicantidote commented 8 months ago

For anyone who finds this while Googling how to use this library like I did, check out this Adafruit tutorial for a more specific, working example.

justmobilize commented 7 months ago

I am working through a refactor for requests and once that is done, will be updating and testing all the examples

justmobilize commented 7 months ago

All examples in https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/151 have been updated to use adafruit_requests.Session and os.getenv

justmobilize commented 7 months ago

@jepler https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/151 is merged. Are the changes sufficient to close this?

anecdata commented 7 months ago

I think jepler is out. Closing due to merge of #151.