Question: 6 ) Your REST API will provide responses to the following GET requests: Request: Response: / states / All state data returned / states /
Your REST API will provide responses to the following GET requests:
Request: Response:
states All state data returned
statescontigtrue All state data for contiguous states Not AK or HI
statescontigfalse All state data for noncontiguous states AK HI
states:state All data for the state URL parameter
states:statefunfact A random fun fact for the state URL parameter
states:statecapital state: stateName, capital: capitalName
states:statenickname state: stateName, nickname: nickname
states:statepopulation state: stateName, population: population
states:stateadmission state: stateName, admitted: admissionDate
NOTES on GET routes:
If you have a catch all for routes that do not exist in your server, you will not need to check if
URL parameters exist. If they are entered wrong, the response will be a
The :state URL parameter above represents state codes like KS NE TX NY etc. Entering in
full state names should result in a
Check the example application to verify the exact responses expected.
Also check the example application for expected messages when required parameters are not
received or no fun facts are found for a requested state.
Notice contig above is a query parameter where :state is a URL parameter.
All state data means all state data from statesData.json merged with the fun facts stored in
MongoDB.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
