Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3f721eeb6e
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (16 sloc) 0.653 kB
<section name="nodejs">
<p class="ioDesc">In</p>
<pre class="incoming brush:js">
var request = require("request");
<% if @method is "GET" and not @headers: %>
request("<%= @apiUrl %><%= @url %>", function (error, response, body) {
<% else : %>
request({
url: "<%= @apiUrl %><%= @url %>",<% if @body: %>
body: <%= @helpers.escape @body.join('') %>,<% end %><% if @helpers.isNotEmpty @headers: %>
headers: {<%= ('"'+header+'": "'+value+'"' for header,value of @headers).join(", ") %>}, <% end %>
method: "<%= @method.toUpperCase() %>"
}, function (error, response, body) {
<% end %> console.log("Reponse received", response);
});
</section>
Jump to Line
Something went wrong with that request. Please try again.