Closed GerdZanker closed 3 years ago
The BoschSHCBridgeHandler has already some helper methods which could be used instead of creating a request from zero:
createServiceUrl
: To create the URL to send the request tocreateRequest
: To create the request by providing the http client (might be removed), the http method, the url and the data to sendWe should use those first in the places where the requests are created and add an additional method afterwards if we still see a need :)
@GerdZanker Did you find the methods I mentioned? Do you still see a need for additional methods?
@GerdZanker Should we close this issue or do you see the need for more helper methods than the ones mentioned above?
We close this issue. In the meantime our code is refactored multiple times and better compared to last summer.
Add a new request function into
BoschHttpClient
to make simple calls likedoHttpRequest("smarthome/devices")
possible. We have at least three places inBoschSHCBridgeHandler'' where we create http requests with duplicated code parts which can be replaced by the `´doHttpRequest
function.Here an example