더북(TheBook)

URL 패턴에 매개변수를 적용하여 웹 요청을 전달해 보자.

/users/1에 GET 요청을 전송한다.

명령 프롬프트

$ curl http://localhost:8080/users/1

retrieve user

/users/1/addresses/2에 GET 요청을 전송한다.

명령 프롬프트

$ curl http://localhost:8080/users/1/addresses/2

retrieve user's address

/users에 GET 요청을 전송한다.

명령 프롬프트

$ curl http://localhost:8080/users

404 page not found

/users에 POST 요청을 전송한다.

명령 프롬프트

$ curl http://localhost:8080/users -d ''

/users/1/addresses에 POST 요청을 전송한다.

명령 프롬프트

$ curl http://localhost:8080/users/1/addresses -d ''

create user's address

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.