如何访问 System.Net.Http.HttpConnectionResponseContent 的响应正文?

Nic*_*ckG 5 sendgrid .net-core asp.net-core

如何访问 System.Net.Http.HttpConnectionResponseContent 的响应正文?

我正在尝试使用 SendGrid API 发送电子邮件,它返回一个“HttpConnectionResponseContent”对象。如何才能真正获取响应正文(字符串)或 JSON?我什至看不到如何掌握底层流。

在此输入图像描述

Lou*_*raQ 7

你可以通过这个来获取内容主体:

response.Body.ReadAsStringAsync()
Run Code Online (Sandbox Code Playgroud)

你可以参考这个