Extracts HTTP requests to shared functions.