是否可以从非标准 URL 加载 Picasso 中的图像

Is it possible to load images in Picasso from non-standard URL's

我正在尝试让 Picasso 使用非标准图像 URLs。

我目前正在通过以下方式实施:

String url = "http://someexampledomain.com/gallery.php?action=photo&phid=213"

Picasso.with(viewGroup.getContext()).load(url).placeholder(R.drawable.default_avatar_circular).error(R.drawable.default_avatar_circular).into(holder.postPhoto);

以上代码导致加载错误占位符图像。 (请注意,我提供的 link 是一个虚拟的 link。我无法提供实际的 link,因为它是私有 API)。

但是以下工作:

String url = "http://img4.wikia.nocookie.net/__cb20100125172609/starwars/images/thumb/f/f3/Yoda_naturist.jpg/200px-Yoda_naturist.jpg."

Picasso.with(viewGroup.getContext()).load(url).placeholder(R.drawable.default_avatar_circular).error(R.drawable.default_avatar_circular).into(holder.postPhoto);

除了 URL 的格式外,我没有更改任何其他内容。第一个 url 在我的浏览器中有效。毕加索不支持URL的第一种吗?

经过一番反复,API 开发人员和我意识到这可能是服务器端身份验证问题。经过一番调查,事实证明确实如此。

使用适当的身份验证凭据更改请求 URL 导致图像通过 Picasso 成功加载。

我想如果其他人 运行 遇到类似问题,我会在这里提到这一点。