ajax_setup.js 398 B

123456789101112
  1. var $ = require('jquery');
  2. var _ = require('underscore');
  3. // Set up some headers and options for every request.
  4. $.ajaxPrefilter(function(options) {
  5. options['headers'] = _.defaults(options['headers'] || {}, {
  6. 'X-UserAgent': USER_AGENT,
  7. 'Accept': 'application/vnd.nsq; version=1.0'
  8. });
  9. options['timeout'] = 20 * 1000;
  10. options['contentType'] = 'application/json';
  11. });