Skip to content

Instantly share code, notes, and snippets.

@biot023
Created April 7, 2010 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biot023/359437 to your computer and use it in GitHub Desktop.
Save biot023/359437 to your computer and use it in GitHub Desktop.
uri = URI.parse( "https://myapp.heroku.com" )
http = Net::HTTP.new( uri.port, uri.host )
http.use_ssl = true
request = Net::HTTP::Post.new( "/mobile_app/timesheet_uploads.json" )
request["content-type"] = "application/json"
request.body = JSON.generate( { upload_data: upload_data } )
request.basic_auth( MyConfig::USERNAME, MyConfig::PASSWORD )
response = http.request( request )
# last line creates this error: "getaddrinfo: nodename nor servname provided, or not known"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment