Revert "revert httpagent change"

This reverts commit 3ee8d6e847ac1482d0e274cb656cdc0d456536ca.