reqres.in으로 ajax 연습하기

  • Reqres 에서 다양한 api를 제공하고있다
  • cors를 허용하기 때문에 localhost에서도 요청을보내고 응답을 받을 수 있다
  • ajax 연습이나, 간단한 앱을 만들 때, 서버를 만들지 않고,
  • reqres에서 제공하는 api를 사용할 수 있겠다

get api

https://reqres.in/api/users?page=2 // 유저 목록 2페이지 보기
https://reqres.in/api/users/2 // 2번 유저 보기
https://reqres.in/api/users/23 // 23번 유저 보기(없는 유저)

// products보기, products 부분은 어떤 문자열로든 치환이 가능해서 원하는 느낌의 문자열을 적어주면된다
https://reqres.in/api/products
https://reqres.in/api/products/1

Author

chinsung

Posted on

2020-11-03

Updated on

2021-08-04

Licensed under

댓글