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

How to add custom HEADERS when submit form data, like X-CSRF-TOKEN and so on #305

Closed
farindra opened this issue Jun 22, 2019 · 4 comments
Closed
Assignees
Labels

Comments

@farindra
Copy link

Hai I'm use laravel framework and require X-CSRF-TOKEN to all request for API,
How to add custom HEADERS when submit form data, like X-CSRF-TOKEN and so on

@jenssogaard
Copy link
Contributor

Hi @farindra. Your question is likely more pertaining to Laravel rather than CF, but let me try to help you out.

  1. Expose the token to the client eg. by writing it to a variable on window. Here is an example of how to do that.
  2. I assume you are doing an AJAX request? If so just pass the token like this.

If you are doing a traditional submit you need to add the tokens as hidden fields to your form like this.

@farindra
Copy link
Author

yes @jenssogaard i know that all method, but in chat mode those not working. where is submit code in chat mode?

@jenssogaard
Copy link
Contributor

@farindra can you please share more code? Maybe screenshots of your code or the form with X-CSRF token. Without more detail, it is too hard to figure out what is wrong.

@aman244221
Copy link

Can you tell me that....how can i make a request in html csrf poc with X-csrf-token http header ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants