Use PHP functions for GET and HEAD requests