如何使用 Lotus-Script 解码 gzip 编码 JSON
How to decode a gzip encoded JSON using Lotus-Script
我从 http 请求中获得了 gzip 编码的 JSON 内容,但我不知道如何在 Lotus Script 中对其进行解码。
Set webRequest = Session.createhttprequest()
Call webRequest.Setheaderfield("cache-control", "no-cache")
Call webRequest.Setheaderfield("Connection", "keep-alive")
Call webRequest.Setheaderfield("Content-Type", "application/json")
Call webRequest.Setheaderfield("Authorization", "Bearer " + accessToken)
Call webRequest.Setheaderfield("Accept", "*/*")
Call webRequest.Setheaderfield("Host", "graph.microsoft.com")
Call webRequest.Setheaderfield("accept-encoding", "gzip, deflate")
ret = webRequest.Get(Url)
ForAll b In ret
responsJSON = responsJSON + Chr(b)
End ForAll
Set jsnav = session.CreateJSONNavigator(responsJSON)
我期待 JSON 但收到此错误消息 "Unable to Parse JSON string: Invalid value. Offset0"
您使用的 Domino/Notes 是哪个版本?尝试 10.0.1 FP2 并使用 set webRequest.PreferJSONNavigator = true。这将直接重新调整 JSONNavigator 并跳过 https://www-01.ibm.com/support/docview.wss?uid=ibm10875724
中确定的一些问题
我从 http 请求中获得了 gzip 编码的 JSON 内容,但我不知道如何在 Lotus Script 中对其进行解码。
Set webRequest = Session.createhttprequest()
Call webRequest.Setheaderfield("cache-control", "no-cache")
Call webRequest.Setheaderfield("Connection", "keep-alive")
Call webRequest.Setheaderfield("Content-Type", "application/json")
Call webRequest.Setheaderfield("Authorization", "Bearer " + accessToken)
Call webRequest.Setheaderfield("Accept", "*/*")
Call webRequest.Setheaderfield("Host", "graph.microsoft.com")
Call webRequest.Setheaderfield("accept-encoding", "gzip, deflate")
ret = webRequest.Get(Url)
ForAll b In ret
responsJSON = responsJSON + Chr(b)
End ForAll
Set jsnav = session.CreateJSONNavigator(responsJSON)
我期待 JSON 但收到此错误消息 "Unable to Parse JSON string: Invalid value. Offset0"
您使用的 Domino/Notes 是哪个版本?尝试 10.0.1 FP2 并使用 set webRequest.PreferJSONNavigator = true。这将直接重新调整 JSONNavigator 并跳过 https://www-01.ibm.com/support/docview.wss?uid=ibm10875724
中确定的一些问题