【发布时间】:2020-01-17 22:40:36
【问题描述】:
我正在使用retrofit2调用delete api,它在邮递员中正常工作,但在应用程序中出现如下错误
Response{protocol=http/1.0, code=405, message=METHOD NOT ALLOWED, url=http://192.168...
这是我的基本网址
public static final String BASE_URL = "http://192.168.1.127:3222/";
@DELETE("student/{firstname}/{lastname}")
Call<ResponseBody> deleteStudent(@Path("firstname") String firstname, @Path("lastname") String lastname);
我把它称为 java 文件
Call<ResponseBody> call = interfaces.deleteStudent(FirstName,LastName);```
【问题讨论】:
-
请发布完整的错误堆栈?还显示您的基本网址
-
stackoverflow.com/questions/6272381/… 答案已经在这里给出,请检查。 "405 方法不允许在 android 中出现错误请这个关键字得到你的答案"
-
不,这与我的错误无关,我在删除 api 中收到此错误,只有在我的网址对所有 @YogeshBorhade 保持相同的情况下