Allow using headers and authentication in the Http Agent

This commit adds the same support for the headers and authentication
as the change on 0.21 branch, plus adds the same ability for
the HttpAgent.

Change-Id: I12854f4f8a855bb8c261831fb5b201e7e4942f7a