[NRY] adding http agent

Is there a code style policy? All of these braceless if statements with no lines between them make it very hard to read and follow the semantics