Uses $data for GET requests, not just for POST.