adafruit / Adafruit_CircuitPython_Requests

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

Lack of "params" keyword in request() and related methods #88

Closed tekktrik closed 2 years ago

tekktrik commented 2 years ago

It looks like request and related functions don't take a param keyword like their CPython equivalents. However, passing the query parameters as part of the URL does work, so it's not missing that functionality, just how it's achieved. Is there a reason for that?

tannewt commented 2 years ago

I don't think so. We just didn't implement it.

tekktrik commented 2 years ago

If it works without it, is it a change worth making? I could add a PR that just basically takes any params and adds it to the URL so it should be backward compatible. I think the only thing I'd have to make sure of is that I'm quoting and escaping characters appropriately.

tannewt commented 2 years ago

I wouldn't add it because it'll increase the library size.

This is where the "CircuitPython APIs are a subset of CPython APIs" is important. CircuitPython code should work in CPython but not necessarily the other way around. CPython's API is very broad and we simply can't implement it all.

tekktrik commented 2 years ago

Makes sense, sounds good! Closing because the functionality exists then.