【发布时间】:2021-07-27 12:06:20
【问题描述】:
RestSharp中如何处理自定义HTTP错误代码,IRestResponse.HttpStatusCode不允许处理599或其他自定义代码,有什么办法处理吗?请帮忙
我们有一个特定的情况,我们在 HttpStatusCode 中得到 599
【问题讨论】:
标签: c# http restsharp webapi http-error
RestSharp中如何处理自定义HTTP错误代码,IRestResponse.HttpStatusCode不允许处理599或其他自定义代码,有什么办法处理吗?请帮忙
我们有一个特定的情况,我们在 HttpStatusCode 中得到 599
【问题讨论】:
标签: c# http restsharp webapi http-error
检查这个response。
RestResponse response = client.Execute(request);
HttpStatusCode statusCode = response.StatusCode;
int numericStatusCode = (int)statusCode;
【讨论】: