-1

I'm calling Store while loading the extjs application. Now, I need to add CSRF security token in the store and this store should call while loading the application itself. I have added the token like below but request failed and given 500 error.

headers: {
        'X-CSRF-TOKEN': 'token name'
    } 

Anything wrong in the above code?

halfer
  • 19,824
  • 17
  • 99
  • 186
RKCY
  • 4,095
  • 14
  • 61
  • 97
  • A bit more example code would help to see if the ExtJS code is correct. However, 500 errors are server-side problems, so I suggest you try and see if there is more information there. – Robert Watkins Sep 19 '19 at 20:09

1 Answers1

0

You need to add headers parameter in proxy.

Check documentation: Ajax-headers

When using cross-origin resource :

Set variable withCredentials as true and variable useDefaultXhrHeader as false in proxy also.

norbeq
  • 2,923
  • 1
  • 16
  • 20