C#怎么取服务器返回的http400错误json数据

HTTP/1.1 400
Date: xxx
Content-Type: application/json;charset=UTF-8
Connection: keep-alive
Server: openresty/1.17.8.2
X-Application-Context: application
Vary: Accept-Encoding
yak-timeinfo: 1630395580595|28
x-b3-trace: false
Set-Cookie: api_uid=xxxxxxx==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=.xxx.com; path=/
cip: 123,123,123,123
Server-Timing: frombd;dur=0
Content-Length: 121

{"server_time":1630395580,"server_time_ms":1630395580622,"success":false,"error_code":508,"error_msg":"xxx失败"}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

向服务器提交信息,只能取到正常返回的 http 200的数据,像这种错误400的数据就取不到了,如何取到呢?

try catch 捕获异常