doujiyun8846 2016-07-31 08:30
浏览 59


I have a custom script in php that is intended to receive a webhook from a 3rd party CMS (specifically FLG360), search the source for records that match a given field name in the query string (using $_GET), and return/display the results.

When going to the full URL (including the query string) manually, the query string is read by the script and the correct actions are performed.

However, when sending the webhook from the CMS, it does not seem to be able to find or read the query string.

Here's the part of my script that I expected to be reading and actioning the webhook via simple $_GET requests:

$IDtoSearch = $_GET['company'];
$status = $_GET['status'];

Is pulling data from a webhook via php as simple as performing some $_GET requests? I have confirmation from the CMS support team that the webhook is definitely formatted as a query string.

I have added this to the script, in order to record any existing query string to the server's error log:

//capture the webhook and save to error log
$webhookContent = "";
$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
    $webhookContent .= fread($webhook, 4096);

...which is doing its job. Here's what I find in the logs after firing a webhook from the CMS:


All the information from the CMS record seems to be coming in, just not being read or recognised as a query string by my script.

Here's what I get when manually entering a query string on the URL:

, referer:

Not sure what the ", referer:" part means, or why this error is being logged with the full URL as opposed to the above.

Hope somebody can help with this, I'm tearing my hair out.

Please let me know if you need any additional information.

Many thanks.

  • 写回答

2条回答 默认 最新

  • doq13207 2016-07-31 09:04

    Credit to @Aleksej in the comments for this - it was as simple as changing the GET to POST. Problem solved, the script is now doing its job.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 请使用蚁群算法解决下列问题,并给出我完整的代码
  • ¥20 关于php录入完成后,批量更新数据库
  • ¥15 请教往复密封润滑问题
  • ¥15 cocos creator发布ios包
  • ¥15 comsol压电材料数据
  • ¥35 用python实现除法算法中goldschmidt算法
  • ¥15 汇编代码转换成C代码
  • ¥15 除法算法中的归一化具体是怎么变的?
  • ¥20 集成电路的逻辑电路和晶体管简化图
  • ¥15 下载windows builder后的问题