其中 sign 为请求签名,生成签名的方法如下:
拼接待签名字符串 = "[" + timestamp + "] " + method + " " + url
secret 作为密钥使用 HMAC-SHA1 对待签名字符串加密,然后对加密结果 Base64 编码得到请求签名 sign
curl --location 'https://hudson-dev.localhome.cn/openapi/hotel/?skip=0&limit=50' \
--header 'Authorization: {{authorization}}' \
--header 'Timestamp: {{timestamp}}' \
--header 'PartnerId: 1758852059833961'{
"success": false,
"code": "",
"message": "",
"data": [
{
"hotelId": 0,
"nation": "",
"state": "",
"city": "",
"name": "",
"nameCn": "",
"address": "",
"tel": "",
"zip": "",
"gisType": "",
"lng": 0.0,
"lat": 0.0
}
]
}