curl http queries function