Created
March 22, 2013 04:35
-
-
Save DylanLacey/5218959 to your computer and use it in GitHub Desktop.
Using RestClient with the Sauce Labs REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http = "https://saucelabs.com/rest/v1/#{username}/jobs/#{job_id}" | |
body = {"name" => "Log In Test"}.to_json | |
RestClient::Request.execute( | |
:method => :put, | |
:url => http, | |
:user => username, | |
:password => access_key, | |
:headers => {:content_type => "application/json"}, | |
:payload => body | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http_auth = "https://#{username}:#{access_key}@saucelabs.com/rest/v1/#{username}/jobs/#{job_id}" | |
body = {"name" => "Log In Test"}.to_json | |
RestClient.put(http_auth, body, {:content_type => "application/json"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment