3.42Setting the handling when sending the request fails

Created on Aug 17, 2026~1 min read

When an exception occurs while sending an HTTP request, you can perform some error-handling operations.

cs
HttpRequestBuilder.Post("https://furion.net/")    .SetOnRequestFailed((exception, responseMessage) =>     // Note: responseMessage may be null    {        // Example: print the exception message        Console.WriteLine(exception.Message);    });

Note: SetOnRequestFailed can be used together with the exception suppression method SuppressExceptions() to capture and handle request failure information without interrupting the program flow.