Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 17 lines (16 sloc) 0.653 kb
ec8401f0 » Almad
2012-04-01 Initial transfer of language templates
1 <section name="nodejs">
2 <p class="ioDesc">In</p>
3 <pre class="incoming brush:js">
4 var request = require("request");
dd40e498 » Almad
2012-04-11 Adapt examples to new headers object
5 <% if @method is "GET" and not @headers: %>
ec8401f0 » Almad
2012-04-01 Initial transfer of language templates
6 request("<%= @apiUrl %><%= @url %>", function (error, response, body) {
7 <% else : %>
8 request({
9 url: "<%= @apiUrl %><%= @url %>",<% if @body: %>
3f721eeb » zzen
2012-04-11 Better empty headers detection
10 body: <%= @helpers.escape @body.join('') %>,<% end %><% if @helpers.isNotEmpty @headers: %>
dd40e498 » Almad
2012-04-11 Adapt examples to new headers object
11 headers: {<%= ('"'+header+'": "'+value+'"' for header,value of @headers).join(", ") %>}, <% end %>
ec8401f0 » Almad
2012-04-01 Initial transfer of language templates
12 method: "<%= @method.toUpperCase() %>"
13 }, function (error, response, body) {
14 <% end %> console.log("Reponse received", response);
15 });
16
17 </section>
Something went wrong with that request. Please try again.