Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2a6e698784
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (16 sloc) 0.66 kB
<section name="javascript" class="javascript">
<p class="ioDesc">In</p>
<pre class="incoming brush:javascript">
var xhr = new XMLHttpRequest();
xhr.open('<%= @method.toUpperCase() %>', '<%= @apiUrl %><%= @url %>');
<% for header, value of @headers: %>
xhr.setRequestHeader(<%= @helpers.escape header %>, <%= @helpers.escape value %>);
<% end %>
xhr.onreadystatechange = function () {
if (this.readyState == 4) {
alert('Status: '+this.status+\nHeaders: '+JSON.stringify(this.getAllResponseHeaders())+'\nBody: '+this.responseText);
}
};
xhr.send(<%= @helpers.escape @body.join('') %>);
</pre>
</section>
Jump to Line
Something went wrong with that request. Please try again.