Skip to content

Instantly share code, notes, and snippets.

@mensfeld
Created January 10, 2019 09:16
Show Gist options
  • Save mensfeld/0ff9009e7ced616b8699404977c76ce7 to your computer and use it in GitHub Desktop.
Save mensfeld/0ff9009e7ced616b8699404977c76ce7 to your computer and use it in GitHub Desktop.
Net::HTTP::Post
.new('/', 'Content-Type': 'application/json')
.tap { |req| req.body_stream = StringIO.new(operation) }
.tap { |req| req.content_length = operation.bytesize }
.yield_self(&@http.method(:request))
.yield_self(&:body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment