Module: LinkedIn::RequestHelpers

Included in:
Client
Defined in:
lib/linked_in/request_helpers.rb

Instance Method Summary collapse

Instance Method Details

#delete(path, options = {}) ⇒ Object



27
28
29
30
31
32
# File 'lib/linked_in/request_helpers.rb', line 27

def delete(path, options={})
  path = "/v1#{path}"
  response = access_token.delete(path, options)
  raise_errors(response)
  response
end

#get(path, options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/linked_in/request_helpers.rb', line 5

def get(path, options={})
  path = "/v1#{path}"
  response = access_token.get(path, options)
  raise_errors(response)
  response.body
end

#post(path, body = '', options = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/linked_in/request_helpers.rb', line 12

def post(path, body='', options={})
  path = "/v1#{path}"
  default_options = { 'Content-Type' => 'application/xml' }
  response = access_token.post(path, body, default_options.merge(options))
  raise_errors(response)
  response
end

#put(path, body, options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/linked_in/request_helpers.rb', line 20

def put(path, body, options={})
  path = "/v1#{path}"
  response = access_token.put(path, body, options)
  raise_errors(response)
  response
end