POSTMAN中的“向签名添加空参数”是什么意思或做什么?

时间:2018-11-14 09:01:52

标签: wordpress woocommerce postman woocommerce-rest-api oauth-1.0a

我正在尝试向Wordpress WooCommerce API发出POST请求,我正在使用OAuth1.0a。

如果我在邮递员中关闭“ 向签名添加空参数”,则POST请求将引发错误401无效身份验证。而且,如果我在Postman中启用“向签名添加空参数”,则POST请求可以正常工作。

我正在尝试比较POSTMAN reuqest代码,以了解它的不同之处,以便我可以据此更改我的Android代码。

下面是当我切换为“开”时

POST /wp-json/wc/v2/customers?oauth_consumer_key=ck_8a27740aacb884c1f463ffb6e982b77c26f0sdfd&oauth_token&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1542185488&oauth_nonce=TL33sS&oauth_version=1.0&oauth_signature=sdf/ODABgh240M= HTTP/1.1
Host: qnx.abcdef.com
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 1e3b7615-ebc2-e759-5b72-238421ddcf40

{
"username":"abcdef",
"password":"sdfsg",
"email":"abcfgh@gmail.com",
"oauth_consumer_key":"ck_8a27740aacb884c1f463ffb6e982b77c26f0sdfd",
"oauth_signature_method":"HMAC-SHA1",
"oauth_timestamp":"1542185226",
"oauth_nonce":"ympZpB",
"oauth_version":"1.0",
"oauth_signature":"Tc00kNtP+K5g3RoJI9BxcahPbLc="
}

以下是我已关闭“关”的情况

POST /wp-json/wc/v2/customers?oauth_consumer_key=ck_8a27740aacb884c1f463ffb6e982b77c26f0sdfd&oauth_token&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1542185527&oauth_nonce=dDMi3S&oauth_version=1.0&oauth_signature=K6s+kTdAx6b8zEHg15fRQ2hmvQQ= HTTP/1.1
Host: qnx.abcdef.com
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 2a717fe1-c9c0-b76f-0d94-0e3758d4f61e

{
"username":"abcdef",
"password":"sdfsg",
"email":"abcfgh@gmail.com",
"oauth_consumer_key":"ck_8a27740aacb884c1f463ffb6e982b77c26f0sdfd",
"oauth_signature_method":"HMAC-SHA1",
"oauth_timestamp":"1542185226",
"oauth_nonce":"ympZpB",
"oauth_version":"1.0",
"oauth_signature":"Tc00kNtP+K5g3RoJI9BxcahPbLc="
}

0 个答案:

没有答案