Module: CrashHook::Request

Included in:
Crash
Defined in:
lib/crash_hook/request.rb

Constant Summary collapse

TIMEOUT =
4
OPEN_TIMEOUT =
4
CONTENT_TYPES =
{
  :form => 'application/x-www-form-urlencoded',
  :json => 'application/json',
  :yaml => 'application/x-yaml'
}.freeze

Instance Method Summary collapse

Instance Method Details

#delete(url, payload = {}, format = :json) ⇒ Object



24
25
26
# File 'lib/crash_hook/request.rb', line 24

def delete(url, payload={}, format=:json)
  request(:delete, url, payload, format)
end

#get(url, payload = {}, format = :json) ⇒ Object



12
13
14
# File 'lib/crash_hook/request.rb', line 12

def get(url, payload={}, format=:json)
  request(:get, url, payload, format)
end

#post(url, payload = {}, format = :json) ⇒ Object



16
17
18
# File 'lib/crash_hook/request.rb', line 16

def post(url, payload={}, format=:json)
  request(:post, url, payload, format)
end

#put(url, payload = {}, format = :json) ⇒ Object



20
21
22
# File 'lib/crash_hook/request.rb', line 20

def put(url, payload={}, format=:json)
  request(:put, url, payload, format)
end