2013년 11월 27일 수요일

The Protocol Semantics of HTTP

There are rules. In a RESTful system, clients and servers interact only by sending each other messages that follow a predefined protocol.
The HTTP standard defines eight different kinds of messages, These four are the most commonly used:

GET
Get a representation of this resource.

DELETE
Destroy this resource.

POST
Create a new resource underneath this one, based on the given representation.

PUT
Replace this state of this resource with the one described in the given representation.

These two methods are mostly used as a client explores an API:

HEAD
Get the headers that would be sent along with a representation of this resource, but no the represntation itself.

OPTIONS
Discover with HTTP methods this resource respons to.

The other two methods defined in the HTTP standard, CONNECT and TRACE, are only used with HTTP proxies. I won’t be covering them.

I recommend that API designers consider a ninth HTTP method, defined not in the HTTP standard but in a supplement, RFC 5789:

PATCH
Modify part of the state of this resource based on the given representation. If some bit of resource state is not mentioned in the given representation, leave it alone.

PATCH is like PUT, but allows for fine-grained changes to resource state.

댓글 1개:

  1. 윤창이형 반가워요...
    RESTful 정보 검색하다 여기까지 왔네요.
    애기 아빠 되신거 축하드리고요. 좋은 정보 많이 공유해 주세요.

    답글삭제

시스템 부팅시 도커 컨테이너 자동 실행

Docker 컨테이너를 운용중인 시스템이 Reboot 되버리면 컨테이너가 자동으로 올라오지 않아 불편해서 시스템 리붓시 컨테이너를 자동으로 시작되게 init 데몬에 등록하기로 했습니다. 서버는 Ubuntu 17.10 Docker는 17.0...