Class: MyExperimentREST::SessionCookie
- Inherits:
-
Object
- Object
- MyExperimentREST::SessionCookie
- Defined in:
- lib/myexperiment-rest/authentication.rb
Overview
Connects to myExperiment REST API and creates a session cookie object that can be used for basic authentication.
Class Method Summary collapse
-
.create_session_cookie(username, password) ⇒ Object
Returns a session cookie as a string.
Class Method Details
.create_session_cookie(username, password) ⇒ Object
Returns a session cookie as a string.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/myexperiment-rest/authentication.rb', line 12 def self.(username, password) begin # Create a session cookie response = RestClient.post("#{Urls::MYEXPERIMENT_URL}/#{Urls::SESSION_URL}", "<session><username>#{username}</username><password>#{password}</password></session>", {:content_type => 'application/xml'} ) response. rescue Exception => e raise "REST call to acquire workflow resource failed!\n" + e end end |