Class: JIRA::RequestClient
- Inherits:
-
Object
- Object
- JIRA::RequestClient
- Defined in:
- lib/jira/request_client.rb
Overview
Base class for request clients specific to a particular authentication method.
Direct Known Subclasses
Instance Method Summary collapse
-
#make_multipart_request(*args) ⇒ Object
abstract
Abstract method to make a request to the JIRA server with a file upload.
-
#make_request(*args) ⇒ Object
abstract
Abstract method to make a request to the JIRA server.
-
#request(*args) ⇒ Net::HTTPResponse
Makes the JIRA REST API call.
-
#request_multipart(*args) ⇒ Net::HTTPResponse
Makes a multipart request to the JIRA server.
Instance Method Details
#make_multipart_request(*args) ⇒ Object
Abstract method to make a request to the JIRA server with a file upload.
56 57 58 |
# File 'lib/jira/request_client.rb', line 56 def make_multipart_request(*args) raise NotImplementedError end |
#make_request(*args) ⇒ Object
Abstract method to make a request to the JIRA server.
49 50 51 |
# File 'lib/jira/request_client.rb', line 49 def make_request(*args) raise NotImplementedError end |
#request(*args) ⇒ Net::HTTPResponse
Makes the JIRA REST API call.
Returns the response if the request was successful (HTTP::2xx) and raises a JIRA::HTTPError if it was not successful, with the response attached.
Generally you should not call this method directly, but use derived classes.
File uploads are not supported with this method. Use request_multipart instead.
23 24 25 26 27 28 |
# File 'lib/jira/request_client.rb', line 23 def request(*args) response = make_request(*args) raise HTTPError, response unless response.is_a?(Net::HTTPSuccess) response end |
#request_multipart(*args) ⇒ Net::HTTPResponse
Makes a multipart request to the JIRA server.
This is used for file uploads.
Generally you should not call this method directly, but use derived classes.
39 40 41 42 43 44 |
# File 'lib/jira/request_client.rb', line 39 def request_multipart(*args) response = make_multipart_request(*args) raise HTTPError, response unless response.is_a?(Net::HTTPSuccess) response end |