Closed JosefWN closed 5 months ago
Thank you for the feedback, @JosefWN :) I actually had a similar thought and started working on something in #160, but I did not manage to finish the PR yet. In #160 I also tried to implement a more drastic API change, though, letting users set the URL for every request instead of the client, but that was a bit overkill (at least for the time being).
Therefore, I think your proposal looks pretty good! Let me know if you start implementing the changes, otherwise, I could also try to adapt #160 to a more manageable size in the spirit of your proposal :)
Great work on passing the URI rather than constructing it internally (https://github.com/shamblett/coap/pull/169) @JKRhb.
Could it be nice to be able to write something like:
To me it would feel more intuitive and slightly more succinct?
To achieve that we could rename the client
uri
tobaseUri
and have a private function in the client:... which we call in
client._prepare
or similar, I'm a bit rusty so don't know where the best place would be from the top of my head.We could also potentially align the other methods with
send
a tiny bit by passing the uri there too, which would reduce the long argument list by one argument at least:Not sure about it yet, but I can write a PR if any of the suggestions sound good.