HTTP method annotations
The following HTTP method annotations are available:
| Annotation | HTTP Method | Typical Use Case |
|---|---|---|
@GET | GET | Retrieving resources |
@POST | POST | Creating resources |
@PUT | PUT | Replacing resources |
@PATCH | PATCH | Partial updates |
@DELETE | DELETE | Removing resources |
Each annotation requires a path parameter:
@GET("/users") // List users
@GET("/users/{id}") // Get user by ID
@POST("/users") // Create user
@PUT("/users/{id}") // Replace user
@PATCH("/users/{id}") // Update user
@DELETE("/users/{id}") // Delete user