Skip to content

docs: document Axios header configuration for AJAX#10069

Open
asad4230 wants to merge 1 commit intocodeigniter4:developfrom
asad4230:asad4230-patch-1
Open

docs: document Axios header configuration for AJAX#10069
asad4230 wants to merge 1 commit intocodeigniter4:developfrom
asad4230:asad4230-patch-1

Conversation

@asad4230
Copy link

Added instructions on how to set the X-Requested-With header globally when using Axios in the AJAX documentation.

Added Axios information regarding the X-Requested-With header.
@mergeable
Copy link

mergeable bot commented Mar 25, 2026

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
on the framework than you do. Please make it as painless for your contributions to be included as possible.

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';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete one newline.

Can you add a more complete example? Check out the fetch api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants