1 개요[ | ]
- JSONPlaceholder
- 페이크 REST API 서버
JavaScript
Copy
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then((response) => response.json())
.then((json) => {
for (const [k, v] of Object.entries(json)) {
console.log(k, ':', v);
}
});
2 예시[ | ]
동작 | 메소드 | 경로 | 예시URL |
---|---|---|---|
글목록 조회 | GET | /posts | http://jsonplaceholder.typicode.com/posts |
1번 글 조회 | GET | /posts/1 | http://jsonplaceholder.typicode.com/posts/1 |
1번 글의 댓글목록 조회 | GET | /posts/1/comments | http://jsonplaceholder.typicode.com/posts/1/comments |
새글 입력 | POST | /posts | http://jsonplaceholder.typicode.com/posts |
1번 글 수정 | PUT | /posts/1 | http://jsonplaceholder.typicode.com/posts/1 |
1번 글 수정 | PATCH | /posts/1 | http://jsonplaceholder.typicode.com/posts/1 |
1번 글 삭제 | DELETE | /posts/1 | http://jsonplaceholder.typicode.com/posts/1 |
3 같이 보기[ | ]
4 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.