Skip to content

Instantly share code, notes, and snippets.

@adamlwalker
Created February 10, 2015 19:36
Show Gist options
  • Select an option

  • Save adamlwalker/0d83341e9d154b956f52 to your computer and use it in GitHub Desktop.

Select an option

Save adamlwalker/0d83341e9d154b956f52 to your computer and use it in GitHub Desktop.
require 'json'
require 'net/http'
url = URI.parse("http://XXXXXX/api")
params = {
username: 'admin',
password: 'XXXX,
method: 'import_samples',
json: [
{'UID'=>'74809','Name'=>'CoolSampleName', 'Description'=>'freezerpro 6.1.14 testing'}
].to_json
}
response = Net::HTTP.post_form(url, params)
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment