Handling Exceptions caused by HTTP Request
メニューを表示するにはスワイプしてください
Important Points:
- Runtime errors can occur when making API requests. The most notable case is if the URL / URI provided is invalid;
- We use try-catch blocks to enclose the
GetAsyncmethod to make it safe; - The
HttpResponseMessageclass has anIsSuccessStatusCodeattribute, which has the valuetruein case the API successfully responds with the requested data; HttpResponseMessagealso has aStatusCodeattribute which represents the response status code. You can learn more about status codes here;- HTTP status codes are three-digit numbers returned by a server in response to a client's request made to a website or web server. They provide information about the outcome of the request and help troubleshoot issues.
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 16
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 1. 章 16