Yuv*_*eja 3 api android retrofit2
我正在使用 Retrofit2 调用删除 api,它在邮递员中正常工作,但在应用程序中出现错误,如下所示
Response{protocol=http/1.0, code=405, message=METHOD NOT ALLOWED, url=http://192.168...
Run Code Online (Sandbox Code Playgroud)
这是我的基本网址
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);
Run Code Online (Sandbox Code Playgroud)
和java文件我这样称呼它
Call<ResponseBody> call = interfaces.deleteStudent(FirstName,LastName);```
Run Code Online (Sandbox Code Playgroud)

更新了,感谢您的参考@GovindPrajapati,我必须做一些小的更改添加@Field,它对我有用。
@FormUrlEncoded
@HTTP(method = "DELETE", path = "student",hasBody = true)
Call<ResponseBody> deleteStudent(@Field("firstname") String firstname, @Field("lastname") String lastname);
Run Code Online (Sandbox Code Playgroud)