fixed #5420: Update Zero Width Shortener API to v2

This commit is contained in:
Jaex 2021-02-27 03:50:05 +03:00
parent 5682c6ab6e
commit 887d8aea29

View file

@ -47,10 +47,12 @@ public override UploadResult ShortenURL(string url)
{
UploadResult result = new UploadResult { URL = url };
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("url", url);
string json = JsonConvert.SerializeObject(new
{
url = url
});
string response = SendRequest(HttpMethod.GET, "https://us-central1-zero-width-shortener.cloudfunctions.net/shortenURL", args);
string response = SendRequest(HttpMethod.POST, "https://api.zws.im", json, RequestHelpers.ContentTypeJSON);
if (!string.IsNullOrEmpty(response))
{