Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix ruby example for empty GET requests

  • Loading branch information...
commit b5c3b2bbbd1f9ddcbdcf8409e73392d3cd817e3d 1 parent cfe77a1
@Almad Almad authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 ruby.html
View
4 ruby.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.