Core: request.ajax() returns false even if it comes from ajax

Created on 26 Jun 2018  路  5Comments  路  Source: adonisjs/core

Here's my axios code

axios.post('/paktay', { headers: { 'X-Requested-With': true } }).then((res)=>{ console.log(res.data); }); }

Most helpful comment

Hey @kingleuther! 馃憢

Remove the header X-Requested-With, this is automatically set by axios and sound't be true.

Code https://github.com/poppinss/node-req/blob/develop/index.js#L366

All 5 comments

Hey @kingleuther! 馃憢

Remove the header X-Requested-With, this is automatically set by axios and sound't be true.

Code https://github.com/poppinss/node-req/blob/develop/index.js#L366

You won't have to set X-Requested-With. If the request is from browser using axios, then it will set it for you.

Also I recommend using forum or the discord channel for confusions.

@thetutlage noted I will retry that.

Closing since not actionable

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imperez picture imperez  路  4Comments

seanc picture seanc  路  4Comments

blendsoft picture blendsoft  路  3Comments

krunaldodiya picture krunaldodiya  路  3Comments

umaams picture umaams  路  3Comments