티스토리 뷰
반응형
HTTP status codes
HTTP defines a bunch of meaningful status codes that can be returned from your API. These can be leveraged to help the API consumers route their responses accordingly. I've curated a short list of the ones that you definitely should be using:
- 200 OK - Response to a successful GET, PUT, PATCH or DELETE. Can also be used for a POST that doesn't result in a creation.
- 201 Created - Response to a POST that results in a creation. Should be combined with a Location header pointing to the location of the new resource
- 204 No Content - Response to a successful request that won't be returning a body (like a DELETE request)
- 304 Not Modified - Used when HTTP caching headers are in play
- 400 Bad Request - The request is malformed, such as if the body does not parse
- 401 Unauthorized - When no or invalid authentication details are provided. Also useful to trigger an auth popup if the API is used from a browser
- 403 Forbidden - When authentication succeeded but authenticated user doesn't have access to the resource
- 404 Not Found - When a non-existent resource is requested
- 405 Method Not Allowed - When an HTTP method is being requested that isn't allowed for the authenticated user
- 410 Gone - Indicates that the resource at this end point is no longer available. Useful as a blanket response for old API versions
- 415 Unsupported Media Type - If incorrect content type was provided as part of the request
- 422 Unprocessable Entity - Used for validation errors
- 429 Too Many Requests - When a request is rejected due to rate limiting
출처 : http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
Best Practices for Designing a Pragmatic RESTful API
www.vinaysahni.com
반응형
'Study > RESTful' 카테고리의 다른 글
RESTful (REpresentational State Transfer) API. (0) | 2019.04.10 |
---|---|
RESTful api HTTP header method (0) | 2019.04.10 |
RESTFul 웹 서비스 관련 (0) | 2019.04.10 |
RESTful (REpresentational State Transfer) API. (0) | 2016.04.07 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 전자정부프레임워크 tiles
- spring ExcelView
- POI EXCEL
- Database#transaction
- coroutine
- java calendar
- java 폴더구조 구하기
- jstl 커스텀 태그
- jstl foreach
- MyBatis 팁
- 코루틴
- Kotlin
- JSP 세션
- POE Excel 만들기
- java 설치
- JSTL
- github image 첨부시 주의할점
- java 설정
- jstl split
- java 특정문자 갯수구하기
- java 압축 풀기
- mybatis Merge
- spring property
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함