有人可以指导我下面发送httpHeaders的适当方式。我得到了'#34;权限被拒绝"从服务器响应,但我的代码看起来都很好。
put "ABCD" into clientId
put "1234" into clientSecret
put "Authorization: Basic" && base64Encode("clientId:clientSecret") && "Content-Type: application/json"&& "Cache-Control: no-cache" into tHeader
set the httpHeaders to tHeader
post receiveMomoRequest to url "https://server/v1/merchantaccount/merchants/HMXXXXXX/receive"
答案 0 :(得分:1)
每个标题字段应该在一个单独的行上,因此您应该在每个键值之间添加一个返回值:
put "ABCD" into clientId
put "1234" into clientSecret
put "Authorization: Basic" && base64Encode("clientId:clientSecret") & return & "Content-Type: application/json" & return & "Cache-Control: no-cache" into tHeader
set the httpHeaders to tHeader
post receiveMomoRequest to url "https://server/v1/merchantaccount/merchants/HMXXXXXX/receive"