DSP-1349 Refactor for reuse with Apache HTTP Client