Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/swordray/jquery.csrf

Set CSRF token header for jQuery.
https://github.com/swordray/jquery.csrf

csrf csrf-token jquery

Last synced: 8 days ago
JSON representation

Set CSRF token header for jQuery.

Awesome Lists containing this project

README

        

jquery.csrf
===========

Set CSRF token header for jQuery.

## Installation

* Yarn

```bash
yarn add jquery.csrf
```

* NPM

```bash
npm install jquery.csrf
```

## Usage

1. Include jQuery and jquery.csrf.js:

```html


```

2. Include `meta` tag in your page with the CSRF-token:

```html

```

3. Now, whenever you make AJAX request using jQuery, `X-CSRF-Token` will be set to `myCSRFtoken`.

```js
// Example:
$("body").load("ajax/test.html");
```

## Sponsors

* [BaiLu ShuYuan](https://bailushuyuan.org)

## License

Copyright © 2017 Jianqiu Xiao under The [MIT License](http://opensource.org/licenses/MIT).