谷歌游离碱阿比C#.NET示例

编程入门 行业动态 更新时间:2024-10-09 10:28:32
本文介绍了谷歌游离碱阿比C#.NET示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是新来的Goolge的API的开发。我试图让Google.Apis.Freebase.V1 API工作在C#。有没有人对使用C#这个API的一个小例子?我花了过去几天的目光,只能找几个例子为老游离碱API。没有为谷歌API。

I am new to developing with the Goolge API’s. I am trying to get the Google.Apis.Freebase.V1 API working in C#. Does anyone have a small example on using this API in C#? I have spent the last several days looking and can only find a couple of examples for the old Freebase Api. Nothing for the Google API.

我只是在寻找有关设置的API连接,做一个搜索,那么如何处理MQL查询回一个JSON对象一个简单的例子。越简单越好。

I am just looking for a simple example on setting up a connection to the API, doing a search, then how to handle a MQL query back into a Json object. The simpler the better.

由于斯科特

推荐答案

正确的代码使用谷歌API客户端库应该是这个样子:

The correct code to do a MQL query in C# using the Google API Client Library should look something like this:

string API_KEY = "your-api-key-here"; FreebaseService service = new FreebaseService{ Key = API_KEY }; String query = "[{\"id\":null,\"name\":null,\"type\":\"/astronomy/planet\"}]"; FreebaseService.MqlreadRequest request = service.Mqlread(query); string response = request.Fetch(); Console.WriteLine (response);

不幸的是,似乎有某种与客户端库的错误,现在为不返回任何结果。我会尽力弄清楚是怎么回事有

Unfortunately, there seems to be some sort of error with the client library right now as its not returning any results. I'll try to figure out what's going on there.

更新:这个问题似乎是客户端库以及一个alt传递= JSON参数该游离碱API是无法支持。 Python客户端库有一个方法来禁用这一点,但有没有办法做到这一点在.NET。您可以按照为开放的bug 这对谷歌代码项目。

Update: The problem appears to be that the client library passes along an alt=json parameter which the Freebase API is unable to support. The Python client library has a way to disable this but there no way to do it in .Net. You can follow the open bug for this on the Google Code project.

更多推荐

谷歌游离碱阿比C#.NET示例

本文发布于:2023-05-31 10:30:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/389917.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:示例   阿比   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!