C#中的Google.Apis.Urlshortener给出错误JsonReaderException

问题描述 投票:0回答:1

我想使用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 

[请您知道解决方案。谢谢

我想使用Google Nuget软件包来缩短URL。我包含了所有必需的文件。public string shortIt(string url){UrlshortenerService service = new ...

c# google-api nuget url-shortener jsonreader
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.