Created
February 10, 2015 19:30
-
-
Save adamlwalker/8c6a8a50e44d9922051c to your computer and use it in GitHub Desktop.
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 'json' | |
| require 'net/http' | |
| require 'net/http/post/multipart' | |
| url = URI.parse("http://XXXXX/api") | |
| req = Net::HTTP::Post::Multipart.new url.path, | |
| :username=>'Adam', | |
| :password=>'XXXX', | |
| :method=>'import_subjects', | |
| :subject_type=>'Reaction', | |
| json:['flow_state'=>'Available','DNA Number'=>'20140020616','Primer'=>'1011-65'].to_json | |
| res = Net::HTTP.start(url.host, url.port) do |http| | |
| http.request(req) | |
| end | |
| data = JSON.load(res.body) | |
| puts data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment