Class: JIRA::RequestClient

Inherits:
Object
  • Object
show all
Defined in:
lib/jira/request_client.rb

Direct Known Subclasses

HttpClient, OauthClient

Instance Method Summary collapse

Instance Method Details

#make_multipart_request(*args) ⇒ Object

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/jira/request_client.rb', line 27

def make_multipart_request(*args)
  raise NotImplementedError
end

#make_request(*args) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/jira/request_client.rb', line 23

def make_request(*args)
  raise NotImplementedError
end

#request(*args) ⇒ Object

Returns the response if the request was successful (HTTP::2xx) and raises a JIRA::HTTPError if it was not successful, with the response attached.

Raises:



11
12
13
14
15
# File 'lib/jira/request_client.rb', line 11

def request(*args)
  response = make_request(*args)
  raise HTTPError, response unless response.is_a?(Net::HTTPSuccess)
  response
end

#request_multipart(*args) ⇒ Object

Raises:



17
18
19
20
21
# File 'lib/jira/request_client.rb', line 17

def request_multipart(*args)
  response = make_multipart_request(*args)
  raise HTTPError, response unless response.is_a?(Net::HTTPSuccess)
  response
end