Curl Malformed Input To A Url Function