使用JSON响应反序列化

时间:2016-11-10 15:36:27

标签: json vb.net json.net

我在JSON中收到回复,我正在尝试使用

 DeserializeStoreInfoResponse(Storeresponse As String) As String
    Dim obj As New JSON_resultStorePos
    obj = JsonConvert.DeserializeObject(Of JSON_resultStorePos)(Storeresponse)

初始响应是一个HttpResponseMessage,我需要的只是JSON字符串信息。当它是Json格式的一个漂亮的整齐字符串时,所有内容都会反序列化到JSON_resultStorePos表中。但我正在尝试查看初始响应,看看他们的响应中是否有所有内容,并且无法确定HttpResponseMessage中实际JSON内容的写入位置?

这里有一些回应:

?aResponse
{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Strict-Transport-Security: max-age=7776000; includeSubDomains
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Pragma: no-cache
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Cache-Control: no-store
  Date: Thu, 10 Nov 2016 13:37:39 GMT
  Set-Cookie: SERVERID=04-97JSNQEU5RG2G; path=/; HttpOnly
  Server: Apache
  X-Powered-By: Express
  Content-Length: 71
  Content-Type: application/json

?aResponse.Content
{System.Net.Http.StreamContent}
    Headers: {Content-Length: 71
Content-Type: application/json
}
    IsBuffered: True
    bufferSize: 4096
    bufferedContent: {System.Net.Http.HttpContent.LimitMemoryStream}
    canCalculateLength: True
    content: {System.Net.Http.HttpClientHandler.WebExceptionWrapperStream}
    contentConsumed: True
    contentReadStream: Nothing
    disposed: False
    headers: {Content-Length: 71
Content-Type: application/json

如何查看我正在反序列化的JSON字符串?

0 个答案:

没有答案