We have now introduced some more configurable options like auth and timeouts, and are looking to add support for headers and cookies. We also have 2 ways now to set configuration options: via passed in parameters and via helper methods. I think this should be converged into one way of doing configuration. So we basically have two options:
- Introduce a configuration struct and keep the static nature of the methods
This means the calling convention stays mostly the same, but for more advanced usage patterns we will have to pass in a struct with options like timeout, headers, etc set.
- Go a more OO oriented route.
This basically means turning the static namespace into an object and being able to call helper methods on it like set_timeout().
I'm not convinced yet which one is nicer to use, so I'm open for feedback on this one.
We have now introduced some more configurable options like auth and timeouts, and are looking to add support for headers and cookies. We also have 2 ways now to set configuration options: via passed in parameters and via helper methods. I think this should be converged into one way of doing configuration. So we basically have two options:
This means the calling convention stays mostly the same, but for more advanced usage patterns we will have to pass in a struct with options like timeout, headers, etc set.
This basically means turning the static namespace into an object and being able to call helper methods on it like set_timeout().
I'm not convinced yet which one is nicer to use, so I'm open for feedback on this one.