Class: ActionHook::Core::JSONRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/actionhook/core/json_request.rb

Instance Attribute Summary

Attributes inherited from Request

#authentication, #body, #headers, #method, #secret, #url

Instance Method Summary collapse

Methods inherited from Request

#initialize, #uri

Methods included from Security::Headers

#headers_with_security

Methods included from Security::Fingerprinting

#fingerprint

Constructor Details

This class inherits a constructor from ActionHook::Core::Request

Instance Method Details

#serialized_bodyObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/actionhook/core/json_request.rb', line 6

def serialized_body
  return @serialized_body if @serialized_body

  if body.is_a?(Hash) || body.is_a?(Array)
    @serialized_body = JSON.generate(body)
  else
    super
  end

end