Add Api host and Api Version by parameter, to support multiple (host … #385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addition will allow library to support any kind of Host, the main reason for now is to support the Ads Api URLs. I tried to keep it ad dynamic because it was less change and will allow the developers to think on their own regarding (Sandbox url and version). And this change will also leave system backward compatible.
The other important point is the addition of apiVersion inside http( method, I rearranged the parameter sequence because it is private method! and I think apiVersion should be in-front of host.
It was possible to follow the existing convention and put the URL as constant inside library but I think at this point we just need to add another flexibility to provide any host parameter and its handy to give Sanbox Url of Ads this way.
Note that I also added the test and tested those which works fine!