Abstracting a doRequest func for request preparation