July 2018
Intermediate to advanced
268 pages
7h 36m
English
Open your favorite Command Prompt and execute the following command:
curl http://localhost:8080/ -v
You will be redirected to the http://localhost:8080/login page. Your entire application is secured and without logging in, you will not be able to access any content. With form login as the method, you won't be able to test it using curl. Let's change the login method from form (formLogin) to basic (httpBasic) in the Spring Security configuration (the springWebFilterChain bean). Now, execute the following command:
curl http://localhost:8080/api/movie -v -u admin:password
You should now see the raw JSON displaying all of the hardcoded movies. Use other common CURL commands, as follows, to test other endpoints:
curl http://localhost:8080/api/movie/1 ...
Read now
Unlock full access