Created
June 30, 2015 23:24
-
-
Save vilmibm/e27be64ca08e732ca524 to your computer and use it in GitHub Desktop.
This file contains 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
def command(endpoint, payload, version=@version) | |
path = "/commands" | |
payload = JSON.generate({'command' => command, | |
'version' => version, | |
'payload' => payload}) | |
debug("#{path} #{payload}") | |
ret = self.class.post( | |
path, | |
:body => {'payload' => payload}, | |
:options => { | |
:headers => { | |
'Accept' => 'application/json', | |
'Content-Type' => 'application/x-www-form-urlencoded' | |
} | |
} | |
) | |
raise_if_error(ret) | |
JSON.parse(ret.body).uuid | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment