Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Really convert python to objects

  • Loading branch information...
commit 0931a4edbf300948b8b12ed9b2b1aa8e53f3ec18 1 parent 0a9af09
@Almad Almad authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  python.html
View
2  python.html
@@ -9,7 +9,7 @@
<% else if @contentType is "application/json": %>values = dumps(<%= @body.join('') %>)
<% else if @method isnt 'GET': %>values = <%= @helpers.escape @body.join('') %>
<% end %><% if @headers: %>headers = {<%= ('"'+header+'": "'+value+'"' for header,value of @headers).join(", ") %>}
-<% end %>request = Request("<%= @apiUrl %><%= @url %>"<% if @method in ['POST', 'PUT'] : %>, data=values<% end %><% if @headers?.length: %>, headers=headers<% end %>)
+<% end %>request = Request("<%= @apiUrl %><%= @url %>"<% if @method in ['POST', 'PUT'] : %>, data=values<% end %><% if @headers: %>, headers=headers<% end %>)
<% if @method not in ['GET', 'POST'] : %>request.get_method = lambda: '<%= @method %>'
<% end %>response_body = urlopen(request).read()
</pre>
Please sign in to comment.
Something went wrong with that request. Please try again.