diff --git a/Types/HttpListener/Request/Alias.psd1 b/Types/HttpListener/Request/Alias.psd1 index ea3b81c13..7573c745f 100644 --- a/Types/HttpListener/Request/Alias.psd1 +++ b/Types/HttpListener/Request/Alias.psd1 @@ -3,4 +3,5 @@ HostHeader = 'HostName' Subdomains = 'Subdomain' QueryParameters = 'QueryParameter' + XHR = 'IsXmlHttpRequest' } \ No newline at end of file diff --git a/Types/HttpListener/Request/get_IsXmlHttpRequest.ps1 b/Types/HttpListener/Request/get_IsXmlHttpRequest.ps1 new file mode 100644 index 000000000..992f08d79 --- /dev/null +++ b/Types/HttpListener/Request/get_IsXmlHttpRequest.ps1 @@ -0,0 +1,8 @@ +<# +.SYNOPSIS + Determines if the request is an AJAX request. +.DESCRIPTION + Determines if the request was made with XmlHttpRequest. +#> +return ($this.Headers -and + ($this.Headers["X-Requested-With"] -eq "XMLHttpRequest"))