In this challenge, you will need to apply what we've learned about Multithreading
and APIs
to fetch the quickest result between two distinct APIs
.
Both requests will be made simultaneously to the following APIs:
- https://brasilapi.com.br/api/cep/v1/ + cep
- http://viacep.com.br/ws/ + cep + <"/json/>
The requirements for this challenge are:
- Get the API that delivers the
fastest response
and discard the slower response. - The result of the request should be
displayed on the command line
with the address data, as well as which API sent it. Limit the response time to 1 second
. Otherwise, a timeout error should be displayed.