无法获取数据由webhook在JSON字符串中发布

时间:2014-01-06 11:40:37

标签: php json codeigniter webhooks

我正在使用web hook从我们公司的注册页面获取用户详细信息。

以JSON格式从注册页面发布的数据。发布的JSON字符串在

之下
{"FirstName":"dharampal","EmailAddress":"er.dpyadav@gmail.com","Mobile":"123456789","Company":"Instasafe","LandingPageURL":"http://instasafe.com/SignUp","LandingPageId":"11e2-b071-123141050daa"}  

在接收端,我们正在使用PHP codeIgNiter,我尝试了以下方法,但无法获取数据。

 $postedData = $_POST;
 print_r($postedData);

它给出:空数组

我试过的其他方法是:

$postedData = json_decode(file_get_contents('php://input'), TRUE);

print_r($postedData);

它给出:NULL

1 个答案:

答案 0 :(得分:0)

似乎问题是$ostedData$postedData

的拼写错误
$ostedData = json_decode(file_get_contents('php://input'), TRUE);
print_r($postedData);
相关问题