通过这个网址我是HTTPGET返回null。用尽各种办法 [英] Passing this URL to my httpget is returning null. Tried every way

查看:644
本文介绍了通过这个网址我是HTTPGET返回null。用尽各种办法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图小时在这个论坛上,但没有运气每一个可能的方法。 PLEASSE帮助
我有以下服务器的URL

I have been trying for hour every possible method on this forum but no luck. PLEASSE help I have the following server url

字符串URL =<一个href=\"http://namara.io/api/v0/resources/fef59c15-852f-4f4b-aaef-c9475b3d17c6/data?where=%7b%22column%22:3,%22selector%22:%22eq%22,%22value%22:%22Sercan%22%7d\" rel=\"nofollow\">http://namara.io/api/v0/resources/fef59c15-852f-4f4b-aaef-c9475b3d17c6/data?where=%7b%22column%22:3,%22selector%22:%22eq%22,%22value%22:%22Sercan%22%7d\"

下面是我的code:

HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response;
try {
response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
.
.
.

不过,我总是得到空值。当我检查StatusLineReturned code,跟它错误401:Uauthorized。

However i am always getting null values. When I check the StatusLineReturned code, it is saying error 401: Uauthorized.

我不知道它是什么,我做错了什么?为什么它不只是工作!

I have no idea what is it that I am doing wrong? Why it won't just work!

推荐答案

这意见发布一个答案:

如果你尝试在浏览器中打开它,它说是相同的,所以你需要先授权。每在namara.io文档,你必须提供API_KEY

If you'll try to open it in browser, it says the same, so you need to authorize at first. Per docs at namara.io, you have to provide api_key.

这篇关于通过这个网址我是HTTPGET返回null。用尽各种办法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆