How to perform a DELETE request without return type or Callback? [Retrofit]

后端 未结 4 1604
长发绾君心
长发绾君心 2021-02-20 11:07

I need perform a DELETE request using Retrofit. So, my code snippet of the interface looks like this:

@DELETE(\"/api/item/{id}\")
void deleteItem(@Path(\"id\") i         


        
4条回答
  •  醉话见心
    2021-02-20 11:37

        @HTTP(method = "DELETE", path = "/api/item/{id}", hasBody = false)
    fun deleteItemId(
    @Path("id") id: Int
    ) : Call
    
    hasBody = 
    true -> if api has request body
    false -> if api has not a request body
    

提交回复
热议问题