Permalink
Browse files

Fix ruby example for empty GET requests

  • Loading branch information...
1 parent cfe77a1 commit b5c3b2bbbd1f9ddcbdcf8409e73392d3cd817e3d @Almad Almad committed Apr 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ruby.html
View
@@ -6,9 +6,9 @@
<% 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('') %>
+<% 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: %>, values<% end %><% if @helpers.isNotEmpty @headers: %>, headers<% end %>
+<% end %>response = RestClient.<%= @method.toLowerCase() %> "<%= @apiUrl %><%= @url %>"<% if @body and @body.join(''): %>, values<% end %><% if @helpers.isNotEmpty @headers: %>, headers<% end %>
puts response
</pre>
</section>

0 comments on commit b5c3b2b

Please sign in to comment.