Refactor http_client logic

Change-Id: I91d17194199ebe6c761c9aa18234ab09f3377020
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>