webhook的文档位于javascript中,我正在寻找Rails代码。
app.post('/instagram', function(req, res) {
console.log('Instagram request body:');
console.log(req.body);
// Process the Instagram updates here
received_updates.unshift(req.body);
res.sendStatus(200);
});
'req.body',我如何在rails控制器中键入它?
这里是Webhook整个示例项目的链接。 https://github.com/fbsamples/graph-api-webhooks-samples/blob/master/heroku/index.js
我正试图在Instagram媒体帖子中获得评论。
答案 0 :(得分:0)
require 'rest-client'
response = RestClient.post('/instagram')
response.body
require 'net/http'
response = Net::HTTP.post_form(URI('/instagram'))
response.body