Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3f721eeb6e
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (13 sloc) 0.863 kB
<section name="ruby">
<p class="ioDesc">In</p>
<pre class="incoming brush:ruby">
require 'rubygems'
require 'rest_client'
<% if @body and @contentType is "application/x-www-form-urlencoded": %>values = CGI::escape(<%= @helpers.escape @body.join('') %>)
<% else if @body and @contentType is "application/json": %>values = <%= @helpers.escape @body.join('') %>
<% else if @body: %>values = <%= @helpers.escape @body.join('') %>
<% end %><% if @helpers.isNotEmpty @headers: %>headers = {<%= [':'+@helpers.rubyKey header+' => "'+value+'"' for header,value of @headers].join(", ") %>}
<% end %>response = RestClient.<%= @method.toLowerCase() %> "<%= @apiUrl %><%= @url %>"<% if @body: %>, values<% end %><% if @helpers.isNotEmpty @headers: %>, headers<% end %>
puts response
</pre>
</section>
Jump to Line
Something went wrong with that request. Please try again.