https://example.com/posts에 글 목록 요청.{
"name": "John Doe",
"age": 30,
"skills": ["JavaScript", "HTTP"],
"address": {
"city": "Seoul",
"postalCode": "12345"
}
}"name", "skills", "address".30, ["JavaScript", "HTTP"], { "city": "Seoul" }.URL
https://example.com/api/users?page=2&sort=deschttp 또는 httpshttps:// (보안 강화, 암호화된 통신). example.com /api/users ?page=2&sort=desc (2페이지, 내림차순 정렬 요청).메서드(Method)
GET https://example.com/api/posts (모든 글 조회).POST https://example.com/api/posts (새 글 추가).{
"title": "HTTP Basics",
"content": "Learning HTTP is fun!"
}PUT https://example.com/api/posts/1 (1번 글 업데이트 또는 생성).{
"title": "Updated Title",
"content": "This content has been updated."
}PATCH https://example.com/api/posts/1 (1번 글 제목만 수정).{
"title": "Partially Updated Title"
}DELETE https://example.com/api/posts/1 (1번 글 삭제).헤더(Header)
Content-Type: application/json
Authorization: Bearer <your-token>Content-Type: 요청 데이터 형식 지정 (예: JSON). Authorization: 인증 토큰 포함.바디(Body)
{
"title": "Understanding HTTP",
"content": "HTTP is the backbone of the web."
}상태 코드(Status Code)
{
"id": 123,
"title": "HTTP Basics",
"content": "Learning HTTP is fun!"
}헤더(Header)
Content-Type: application/json
Set-Cookie: session_id=abc123; HttpOnly바디(Body)
[
{
"id": 1,
"title": "HTTP Basics",
"content": "Learning HTTP is fun!"
},
{
"id": 2,
"title": "Advanced HTTP",
"content": "Deep dive into HTTP."
}
]GET https://example.com/api/posts: 글 목록 조회. POST https://example.com/api/posts: 새 글 추가. 200 OK: 요청 성공. 201 Created: 리소스 생성 성공. 400 Bad Request: 잘못된 요청. 404 Not Found: 리소스 없음. 500 Internal Server Error: 서버 내부 오류.