Http基础
Last updated
GET /users/1 HTTP/1.1
Host: api.github.com@GET("/users/{id}")
Call<User> getUser(@Path("id") String id, @Query("gender") String gender);POST /users HTTP/1.1
Host: api.github.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
name=godlin&gender=male@FormUrlEncoded
@POST("/users")
Call<User> addUser(@Field("name") String name, @Field("gender") String gender);PUT /users HTTP/1.1
Host: api.github.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
gender=female@FormUrlEncoded
@PUT("/users/{id}")
Call<User> updateUser(@Path("id") String id, @Field("gender") String gender);DELETE /users HTTP/1.1
Host: api.github.com@DELETE("/users/{id}")
Call<User> deleteUser(@Path("id") String id,@Query("gender") String gender);