REST

REST API design principles and best practices

ffsshhttiikk eb7eb92 844 B Updated

File contents

What I do

  • Design RESTful APIs
  • Use proper HTTP methods
  • Implement proper status codes
  • Handle pagination and filtering
  • Version APIs
  • Secure endpoints

When to use me

When building or consuming REST APIs.

HTTP Methods

GET    /users        - List users
GET    /users/:id    - Get user
POST   /users        - Create user
PUT    /users/:id    - Update user (full)
PATCH  /users/:id    - Partial update
DELETE /users/:id    - Delete user

Status Codes

200 OK
201 Created
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Response Format

{
  "data": { "id": 1, "name": "John" },
  "meta": { "total": 100, "page": 1 },
  "links": { "self": "/users/1" }
}

ffsshhttiikk/opencode-agents-skills/tree/main/rest commit eb7eb926cd

Frequently asked questions

npx skillmds@latest add ffsshhttiikk/rest