根据Trello官方文档(https://trello.com/c/IMVYmVG1/1458-webhooks),关于webhook有效负载, “当事件触发时,您将收到以下形式的JSON有效负载:
{
action: { ... }
model: { ... }
}
但是我的webhook没有发布任何“动作”属性。
看看我的回调收到的params:
Started POST "/trello_hooks/doing_callback" for 127.0.0.1 at 2015-02-27 11:29:04 +0100
Processing by TrelloHooksController#doing_callback as HTML
Parameters: {"model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau",
"shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil,
"backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true}, "labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""}},
"trello_hook"=>{"action"=>"doing_callback", "model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau", "shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil, "backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true},
"labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""
}
}
}
}
有什么想法吗?我确定你读这个问题的男人或女人得到了答案:)帮助我!
尽快读完......
答案 0 :(得分:2)
看起来Rails吃了名为action
的参数,可能是为了方便某些浏览器不支持的http动词。