Created
May 28, 2014 00:34
-
-
Save julianeon/cd5b112dd569ff7efd07 to your computer and use it in GitHub Desktop.
PUT example using HTTParty.
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
require 'httparty' | |
subdomain='FAKE' | |
api_token='FAKE' | |
id='FAKE' | |
endpoint="https://#{subdomain}.pagerduty.com/api/v1/escalation_policies/#{id}" | |
token_string="Token token=#{api_token}" | |
data= { | |
name: "New name" | |
} | |
response = HTTParty.put(endpoint, | |
:body => data.to_json, | |
:headers => { "Content-Type" => 'application/json', "Authorization" => token_string}) | |
puts response.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment