Conversation
There was a problem hiding this comment.
the timout aspects of this are getting nasty, bad steer from me, hard to change the timeout when its in the decorator not the class.
for now - just use backoff_max from the instantiation for max_time in the decorator and lose the kwarg approach. That should greatly simplify it. It someone really needs to send two requests with different timeouts from the same app they'll just have to reinstantiate the client (its not a super likely scenario).
I can see why you've gone with urllib here (factor things out) btw but I'd be tempted to see how it looks with requests, its very batteries included and simple. If its more verbose but the code is simpler that's ok.
Last thing, be sure to try the client a bit in anger 😄 , I think the kwarg propogation is off a bit at the moment and it;'d be really obvious if you play around with this a bit, i.e
from dpytools.http_clients.http_custom import HttpClient
client = HttpClient()
client.get("") # <--- try some actual urls, some that work, some that dont. check you're getting those retry logs etc.
mikeAdamss
left a comment
There was a problem hiding this comment.
minor tidyup changes only
Created a HTTP Client that can send get() and post() requests using the python httpclient library.
Changes: