mobify.com/blog/http-requests-are-hard
"A lot of things can go wrong when requesting information over HTTP from a remote web server: requests timeout, servers fail, government operatives cut undersea cables. You get the picture."
Good reminder of how to identify and handle HTTP problems when writing an HTTP Client.
Summary:
- Account for DNS lookup failures
- Set a connection and read timeout
- Be sure to handle HTTP errors
- Check that the response has the content type you expect
- Limit the maximum response size
- Ensure that private URLs are not requestable
- Always. Be. SSLing.
Comments (0)
Sign in to post comments.