Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: scala
Fetching contributors…

Cannot retrieve contributors at this time

file 14 lines (13 sloc) 0.925 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<section name="ruby" class="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 and @body.join(''): %>values = <%= @helpers.escape @body.join('') %>
<% end %><% if @helpers.isNotEmpty @headers: %>headers = {<%= [':'+@helpers.rubyKey header+' => '+@helpers.escape value for header,value of @headers].join(", ") %>}
<% end %>response = RestClient.<%= @method.toLowerCase() %> "<%= @apiUrl %><%= @url %>"<% if @body and @body.join(''): %>, values<% end %><% if @helpers.isNotEmpty @headers: %>, headers<% end %>
puts response
</pre>
</section>
Something went wrong with that request. Please try again.