我正在根据此处的 API 设置网络挂钩:http: //docs.exceptional.io/api/webhooks/
我看到的问题是发布的数据似乎无效。从日志中:
Started POST "/api/1/services/exceptional/13123123123123123123123123123" for 50.16.14.195 at 2012-11-30 04:27:06 +0000
Processing by ApiV1::Services::ExceptionalController#create as XML
Parameters: {"{\"error\":{\"id\":110938603,\"title\":\"# (Test-20) \\\"Test message-20\\\"\",\"sub_title\":null,\"app\":{\"id\":17456,\"name\":\"mysite.com\"},\"last_occurrence\":{\"id\":266224025,\"request_method\":null,\"url\":null,\"occurred_at\":\"2012-11-30T04:27:01 00:00\",\"backtrace\":null},\"environment\":null,\"first_occurred_at\":\"2012-11-30T04:27:01 00:00\",\"last_occurred_at\":\"2012-11-30T04:27:01 00:00\",\"url\":\"http://getexl.com/xasdasddsa\"}}"=>nil, "room_token"=>"123123123123213"}
Completed 500 Internal Server Error in 12ms
TypeError (can't convert Array into String):
app/controllers/api_v1/services/exceptional_controller.rb:20:in `create'
lib/rack/ie_redirect.rb:19:in `call'
路线:
match "/exceptional/:room_token" => "exceptional#create"
关于为什么参数被rails破坏以及如何解决的任何想法?谢谢
控制器代码:
类 ApiV1::Services::ExceptionalController < ApiV1::APIController
def create
exceptional_exception = JSON.parse(params[:error])
end
exception_exception 是行是 rb:20