I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a quick example of how to fake out the response for calling a Google API endpoint. | |
I'm using the QPX Express api as an example, but I'm _assuming_ this could apply accross the board | |
for other Google API's. | |
The reason you would want to do this, is so you don't need to hit the internet to get your results | |
(think, coding on a plane, no internet coverage, no hurting your API allowance, etc). | |
The main trick here is that we need to do two things: | |
1. Create a fake HttpMessageHandler |