Fixes to satisfy sonar after merge of httpclient change
Refactored out duplicate logic
Merge pull request #2 from wallner/refactorRequestMethod

Refactored out duplicate logic