我正在使用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
答案 0 :(得分:0)
似乎问题是$ostedData
和$postedData
$ostedData = json_decode(file_get_contents('php://input'), TRUE);
print_r($postedData);