# URL Anatomy and REST Conventions

Parts of a URL and common REST naming.

```text
https://user@www.example.com:8080/path/to/page?x=1&y=2#section
└─┬─┘  └─┬─┘ └──────┬──────┘└─┬─┘└─────┬─────┘└───┬───┘ └───┬───┘
scheme userinfo   host     port    path      query    fragment
```

| Action | Request |
|---|---|
| List | `GET /users` |
| Read | `GET /users/42` |
| Create | `POST /users` |
| Replace | `PUT /users/42` |
| Update part | `PATCH /users/42` |
| Delete | `DELETE /users/42` |
| Filter and page | `GET /users?role=admin&page=2` |

Use plural nouns, lowercase, hyphens for multiword paths, and versioning such as `/v1/`.
