Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom AJAX settings not being used #17

Open
u01jmg3 opened this issue Dec 15, 2016 · 0 comments
Open

Custom AJAX settings not being used #17

u01jmg3 opened this issue Dec 15, 2016 · 0 comments

Comments

@u01jmg3
Copy link

u01jmg3 commented Dec 15, 2016

  • I use this library along with typeahead in a Laravel application.
  • In order to get things to work correctly with Laravel's auth API logic, you must send an accept header of "application/json".
  • I believe you should be able to set this in Bloodhound as a prepare function but looking at ajax.js none of those settings are ever used when sending the request apart from the URL (o.url).
  • Instead could the request logic be amended to include the correct accept header?
    request.get(o.url).set('Accept', 'application/json').end(function(err, res) {
      if(err) return reject(err);
      resolve(res.body);
    });

--

  • Realistically though, you should be able to set any AJAX setting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant