Most often, send JSON directly to the request body with a header Content-Type application/json. This is not quite the way New Relic does. Similarly, GitHub payload data is encoded.
/ JSON , , , ,
PHP :
$data = file_get_contents('php://input');
var_dump(json_decode($data));
:
$data = $_POST["payload"];
var_dump(json_decode($data));
, , . GitHub Sinatra:
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
JSON , :
post '/' do
push = JSON.parse(request.body.read)
"I got some JSON: #{push.inspect}"
end
, . JSON JSON. JSON , . - :
{
"notification_id": "akjfd8",
"events": [ ... ]
}
JSON, , RequestBin. , JSON .