将 non-ascii 个字符发送到 Zapier 捕获钩子
Sending non-ascii characters to a Zapier catch hook
已设置一个 zapier 网络钩子来捕获发送给它的 JSON。
问题是如果 JSON 包含任何 non-standard 个字符,例如重音字符,挂钩从不捕获数据(不显示错误,只是不记录任何内容)。
Id catch hook 切换到 'catch raw hook' 然后接收到数据,但我不知道如何将原始数据转换为 JSON 以供将来使用。使用 catch raw 钩子,捕获的数据是例如如下(名称值中有特殊字符ø):
raw_body
[{"id":2426,"name":"James Hømmett"}]
headers__http_host
hooks.zapier.com
headers__http_x_request_id
b8578a4455fea95c3287e939e304752c
headers__http_x_real_ip
[redacted IP address]
headers__http_x_forwarded_for
[redacted IP address]
headers__http_x_forwarded_host
hooks.zapier.com
headers__http_x_forwarded_port
443
headers__http_x_forwarded_proto
https
headers__http_x_scheme
https
headers__http_x_original_forwarded_for
[redacted IP address]
headers__content_length
559
headers__http_accept_encoding
gzip,deflate
headers__content_type
application/json; charset=utf-8
headers__http_user_agent
Apache-HttpClient/4.5.13 (Java/11.0.9.1)
如您所见,charset=utf8
是在 content-type header 中指定的。
JSON 验证 jsonlint.com
有什么想法吗?
如果您使用的是付费帐户,则可以添加 Zapier 代码 returns JSON.parse(inputData.raw_body)
步骤,以便数据可用在以后的步骤中。
但是,不处理非 ascii 字符可能是一个错误,因此如果您还没有提供支持,则值得联系:https://zapier.com/contact
已设置一个 zapier 网络钩子来捕获发送给它的 JSON。
问题是如果 JSON 包含任何 non-standard 个字符,例如重音字符,挂钩从不捕获数据(不显示错误,只是不记录任何内容)。
Id catch hook 切换到 'catch raw hook' 然后接收到数据,但我不知道如何将原始数据转换为 JSON 以供将来使用。使用 catch raw 钩子,捕获的数据是例如如下(名称值中有特殊字符ø):
raw_body
[{"id":2426,"name":"James Hømmett"}]
headers__http_host
hooks.zapier.com
headers__http_x_request_id
b8578a4455fea95c3287e939e304752c
headers__http_x_real_ip
[redacted IP address]
headers__http_x_forwarded_for
[redacted IP address]
headers__http_x_forwarded_host
hooks.zapier.com
headers__http_x_forwarded_port
443
headers__http_x_forwarded_proto
https
headers__http_x_scheme
https
headers__http_x_original_forwarded_for
[redacted IP address]
headers__content_length
559
headers__http_accept_encoding
gzip,deflate
headers__content_type
application/json; charset=utf-8
headers__http_user_agent
Apache-HttpClient/4.5.13 (Java/11.0.9.1)
如您所见,charset=utf8
是在 content-type header 中指定的。
JSON 验证 jsonlint.com
有什么想法吗?
如果您使用的是付费帐户,则可以添加 Zapier 代码 returns JSON.parse(inputData.raw_body)
步骤,以便数据可用在以后的步骤中。
但是,不处理非 ascii 字符可能是一个错误,因此如果您还没有提供支持,则值得联系:https://zapier.com/contact