docs: document Axios header configuration for AJAX#10069
docs: document Axios header configuration for AJAX#10069asad4230 wants to merge 1 commit intocodeigniter4:developfrom
Conversation
Added Axios information regarding the X-Requested-With header.
|
Hi there, asad4230! 👋 Thank you for sending this PR! We expect the following in all Pull Requests (PRs).
Important We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md Sincerely, the mergeable bot 🤖 |
| .. code-block:: javascript | ||
|
|
||
| axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | ||
|
|
There was a problem hiding this comment.
Delete one newline.
Can you add a more complete example? Check out the fetch api
michalsn
left a comment
There was a problem hiding this comment.
I would like to merge this as-is for now and then refactor the entire page afterward. Adding an Axios section makes sense, but Axios is already mentioned in a few places, so this seems like a good start.
Added instructions on how to set the X-Requested-With header globally when using Axios in the AJAX documentation.