Moved http request into a file