Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created January 5, 2012 18:00
Show Gist options
  • Save nerdyworm/1566390 to your computer and use it in GitHub Desktop.
Save nerdyworm/1566390 to your computer and use it in GitHub Desktop.
require 'rest-client'
API_KEY = "9lGH8iwbR9SKrVcKk"
END_POINT = "http://localhost:8080"
def make_url(path)
"#{END_POINT}#{path}"
end
def post(path, params)
RestClient.post make_url(path), params
end
response = post('/deals.json', {
:api_key => API_KEY,
:deal => {
:name => "a deal name",
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment