简体   繁体   English

android应用程序中的HttpURLConnection给我“找不到源”错误,无法弄清原因

[英]HttpURLConnection in android app giving me “Source not found” error, can't figure out why

I have this simple line in an AsyncTask class that goes like this: 我在AsyncTask类中有以下简单代码:

httpconn = (HttpURLConnection)(new URL("http://blynndas.w12.wh-2.com/api/" + params[0]).openConnection());

(an example would be " http://blynndas.w12.wh-2.com/api/order ") (例如“ http://blynndas.w12.wh-2.com/api/order ”)

where params would be the controller name in the Web API that I have. 其中params是我拥有的Web API中的控制器名称。 Anyways, it gives that infernal "Source not found" error, but for the life of me I can't figure out why. 无论如何,它给出了地狱性的“找不到源”错误,但是对于我一生来说,我不知道为什么。

I've looked into many of the similar posts on stackoverflow, but no joy. 我研究了许多关于stackoverflow的类似文章,但并不高兴。 Any ideas? 有任何想法吗?

网址中可能有一些空格用于连接。请通过使用静态网址进行连接进行检查,如果它可以正常工作,则说明网址中存在空格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM