我正在设置一个Zapier订阅挂钩,这是它生成的代码供我测试...
const options = {
url: 'https://www.my-web-site-url.com/zapier/api/subscribe/hook',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': bundle.authData.api_key,
'Accept': 'application/json'
},
params: {
'api_key': bundle.authData.api_key
},
body: {
'helloWorld': '123123',
'hookUrl': bundle.targetUrl
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = z.JSON.parse(response.content);
return results;
});
当我在Zapier中运行测试时,它成功地发布到了我的PHP脚本中,但是当我尝试解析我的Php脚本中的主体变量:“ hookUrl”或“ helloWorld”时,我只是空白(没有nada) 。
这是我简单的PHP代码:
echo $_POST['helloWorld'];
我在做错什么,因为我看不到为什么$ _POST ['helloWorld']不会呈现“ 123123”而不是“”。