我正在使用Retrofit2进行API解析.
虽然使用retrofit1.9.0post和get方法都能正常工作.但是retrofit 2.1.0在get方法中使用时会出现错误:
java.lang.IllegalArgumentException:baseUrl必须以/结尾
我检查了我的代码,没有问题,它正在为post方法工作.
Retrofit retrofit= new Retrofit.Builder()
.baseUrl("sample.com/ecomtest/index.php?route=api/")
.addConverterFactory(GsonConverterFactory.create())
.build();
Run Code Online (Sandbox Code Playgroud)