Code for HTTP stuff.
Not tested