Write simple http request function