Editor preSubmit add csrf header

Editor preSubmit add csrf header

paulsc70paulsc70 Posts: 6Questions: 3Answers: 1

Is it possible for me to add a header to the ajax request with the preSubmit event?
I was able to find this structure in the event handler: e.currentTarget.s.ajax.create.headers but couldn't find a way to add the header. Is there a standard way to do it or am I just overlooking something obvious. I need to add the header through an event.

Thanks,
Paul

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,338Questions: 1Answers: 10,439 Site admin
    Answer ✓

    The ajax option as an object can be used for this:

    ajax: {
      url: ...,
      headers: ...
    }
    

    Or if you are giving an object per CRUD actions:

    ajax: {
      create: {
        url: ...,
        headers: ...
      },
      ...
    }
    

    Allan

This discussion has been closed.