completed function to retrieve request string