Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d0f5018dba
Fetching contributors…

Cannot retrieve contributors at this time

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