mirror of
https://github.com/czhu12/canine.git
synced 2026-05-05 11:20:35 -05:00
14 lines
443 B
Ruby
14 lines
443 B
Ruby
module InboundWebhooks
|
|
class ApplicationController < ActionController::API
|
|
private
|
|
|
|
# Returns the payload for the webhook as a String
|
|
#
|
|
# Some services use multipart/form-data to encapsulate their JSON payload
|
|
# For multipart/form-data we will let Rails parse and then dump the params as JSON
|
|
def payload
|
|
@payload ||= request.form_data? ? request.request_parameters.to_json : request.raw_post
|
|
end
|
|
end
|
|
end
|