lib/onering/cli/call.rb in onering-client-0.0.56 vs lib/onering/cli/call.rb in onering-client-0.0.57
- old
+ new
@@ -26,10 +26,15 @@
opt :method, "The HTTP method to use when performing the request", :default => 'get', :short => "-m", :type => :string
end
end
def self.run(args)
- rv = @api.request(@opts[:method], args.first)
+ data = STDIN.read() unless STDIN.tty?
+
+ rv = @api.request(@opts[:method], args.first, {
+ :body => data
+ }.compact)
+
return (rv.parsed_response || rv.response.body)
end
end
end
end
\ No newline at end of file