Welcome Guest, Not a member yet? Register   Sign In
is_ajax_request() doesn't work from mobile apps
#2

(This post was last modified: 04-07-2015, 05:05 AM by Narf.)

is_ajax_request() depends on a non-standard HTTP request header named 'X-Requested-With', that for AJAX requests should have the value of 'XMLHTTPRequest' (case-insensitive). It is the client that sends or doesn't sent that header, and as far as any server is concerned - an HTTP request is an HTTP request, it doesn't know who, what or how has sent it.

If the client (in your case, the mobile device) doesn't say that it is sending an AJAX request, the server has no way of knowing that. Therefore, if anything can be "fixed" it's the client.
Reply


Messages In This Thread
RE: is_ajax_request() doesn't work from mobile apps - by Narf - 04-07-2015, 05:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB