Factor out http request code and use a microlibrary for that.