Try using http_request instead of executing curl