我正在尝试使用 CF 对 Zendesk API 进行身份验证。我已经能够通过 curl 成功地做到这一点。现在我试图找出放置参数的位置,<cfhttp>以便我可以进行身份验证并创建用户。
curl -v -u email@email.com/token:************************* https://test.zendesk.com/api/v2/users.json \
-H "Content-Type: application/json" -X POST -d '{"user": {"name": "Roger Wilco", "email": "roge@example.org"}}'
我认为我的问题与要对其进行身份验证的用户详细信息的放置有关。由于我对 curl 不熟悉,因此我认为这里的某个人可能知道将其应用于哪种参数类型。
<cfsavecontent variable="jsonString">
{"user": {"name": "Roger Wilco", "email": "roge@example.org"}}
</cfsavecontent>
<cfhttp url="https://test.zendesk.com/api/v2/users.json" method="post">
<cfhttpparam type="header" name="Content-Type" value="application/json">
<cfhttpparam type="header" name="Accept" value="*/*">
<cfhttpparam type="header" name="-u" value="email@email.com/token:*************************">
<cfhttpparam type="body" value="#jsonString#">
</cfhttp>
关于如何定位/定位变量以便进行身份验证的任何提示都会很棒。
提前致谢。