Skip to content

Add a way to set custom headers to request #791

@kytosai

Description

@kytosai

I want to set a header token with ajax request of infinite-scroll. But it haven't option to do it.

I try

`$.ajaxSetup({
beforeSend: setHeader
});

var setHeader = function (xhr) {
  console.log('beforeSend');
  xhr.setRequestHeader('token', '33vscths658h7996d324rqft1s');
}`

or

$.ajaxSetup({ headers: { 'token': '33vscths658h7996d324rqft1s' }, });

But it cannot work.
Help me, please ! Thank you !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions