0

我想使用 Google Nuget 包来缩短 URL。我包括了所有必需的文件

 public string shortenIt(string url)
    {       
        UrlshortenerService service = new UrlshortenerService(new BaseClientService.Initializer()
        {
            ApiKey = "*************************",
            ApplicationName = "***************",
        });
        Url response = service.Url.Insert(new Url { LongUrl = url }).Execute();
        return response.Id;
    }

我收到以下错误

  Url response = service.Url.Insert(new Url { LongUrl = url }).Execute();

错误

  JsonReaderException: Error parsing NaN value. Path '', line 1, position 1 

我很想知道解决方案..谢谢

4

1 回答 1

1

Google 的 URL 缩短器不再可用,您应该转而使用 Google 的 Firebase 动态链接。

来源:https ://developers.googleblog.com/2018/03/transitioning-google-url-shortener.html

于 2019-12-30T11:59:03.443 回答