java.lang.IllegalArgumentException:带有改型的非法URL [英] java.lang.IllegalArgumentException: Illegal URL with retrofit
问题描述
我正在尝试在我的应用程序中调用一个api 我有以下网址模板
i'm trying to call an api in my application i've the following url template
test-test.domainname.com/feeds/json/v3/attribute/attribute
test-test.domainname.com/feeds/json/v3/attribute/attribute
我正在使用改造2 但我收到以下致命异常
i'm using retrofit 2 but i get the following fatal exception
非法网址:test-test.domainname.com
Illegal URL: test-test.domainname.com
这是我的界面
public interface Iinterface{
@GET("feeds/json/v3/attribute/"+attribute)
Call<ArrayList<result>>getresult();
}
有人可以帮助我解决这个问题吗?
can someone help me with this problem ...
推荐答案
我的基本URL在这里:http://myapiname.azurewebservices.net
my base URL is here: http://myapiname.azurewebservices.net
和feed方法是这样的:
and feed method is like that :
public interface Iinterface{
@GET("/feeds/json/v3/attribute/"+attribute)
Call<ArrayList<result>>getresult();
}
并且运行良好.请添加http or https
,然后重试
And working perfectly. Please add http or https
and try again
这篇关于java.lang.IllegalArgumentException:带有改型的非法URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!