Skip to content

Commit be9d4e7

Browse files
committed
Update rest-api-guidelines.md
1 parent 6c2bae5 commit be9d4e7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

rest-api-guidelines.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This document covers the best practices on designing a RESTful API (with the exc
1414

1515
## Practices
1616

17-
1. Use HTTP-verbs to denote actions:
17+
### Use HTTP-verbs to denote actions:
1818

1919
`GET` - read/retrieve a resource
2020
`POST` - create a new resource
@@ -40,7 +40,7 @@ POST /cars/1234/delete
4040
```
4141

4242

43-
1. Use nouns, not verbs
43+
### Use nouns, not verbs
4444

4545
Good:
4646
```
@@ -53,7 +53,7 @@ Bad:
5353
```
5454

5555

56-
1. Use **plural** nouns (and do not mix with singular)
56+
### Use **plural** nouns (and do not mix with singular)
5757

5858
Good:
5959
```
@@ -69,7 +69,7 @@ Bad:
6969

7070

7171

72-
1. GET method should be idempotent (should not change state)
72+
### GET method should be idempotent (should not change state)
7373

7474
Good:
7575
```
@@ -85,7 +85,8 @@ GET /orders/1234/activate
8585

8686

8787

88-
1. Make a version **mandatory**. **NEVER** release unversioned api for public usage. Avoid dot-notation:
88+
### Make a version **mandatory**.
89+
**NEVER** release unversioned api for public usage. Avoid dot-notation:
8990

9091
GOOD:
9192
```
@@ -100,7 +101,7 @@ BAD:
100101

101102

102103

103-
1. Use HTTP status codes for errors:
104+
### Use HTTP status codes for errors:
104105

105106
| Code | Status | Meaning |
106107
| ---- | ------ | ------- |
@@ -117,7 +118,7 @@ BAD:
117118

118119

119120

120-
1. Use JSON-wrapper for any kind of return messages:
121+
### Use JSON-wrapper for any kind of return messages:
121122

122123
Good:
123124
```
@@ -140,7 +141,7 @@ Good:
140141

141142

142143

143-
1. Use parameters for filtering/sorting/limiting. Delimit the *multivalue* parameters with comma.
144+
### Use parameters for filtering/sorting/limiting. Delimit the *multivalue* parameters with comma.
144145

145146
Good:
146147
```
@@ -156,7 +157,7 @@ Bad:
156157
```
157158

158159

159-
1. Use subresources to denote relations. Do not make deep nesting:
160+
### Use subresources to denote relations. Do not make deep nesting:
160161

161162
Good:
162163
```
@@ -173,7 +174,7 @@ Bad:
173174

174175

175176

176-
1. It is a good idea to have different formats for endpoint responses:
177+
### It is a good idea to have different formats for endpoint responses:
177178
1. JSON `/orders`
178179
2. XML `/orders.xml`
179180
3. JSONP `/orders?callback=jsonp_callback`
@@ -186,4 +187,4 @@ This guidelines is based on these resources:
186187
1. https://github.com/WhiteHouse/api-standards
187188
1. http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
188189
1. http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/
189-
1. http://www.slideshare.net/mario_cardinal/best-practices-for-designing-pragmatic-restful-api
190+
1. http://www.slideshare.net/mario_cardinal/best-practices-for-designing-pragmatic-restful-api

0 commit comments

Comments
 (0)