We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d006e1d commit fc5d994Copy full SHA for fc5d994
tests/header_set.js
@@ -0,0 +1,20 @@
1
+var sys = require('util');
2
+var XMLHttpRequest = require("./lib/xmlhttprequest").XMLHttpRequest;
3
+
4
+var xhr = new XMLHttpRequest();
5
6
+xhr.onreadystatechange = function() {
7
+ sys.puts("State: " + this.readyState);
8
9
+ if (this.readyState == 4) {
10
+ sys.puts("Complete.\nBody length: " + this.responseText.length);
11
+ sys.puts("Body:\n" + this.responseText);
12
+ }
13
+};
14
15
+xhr.open("GET", "http://localhost/ua_test.php");
16
17
+xhr.disableHeaderCheck(true)//Disable check
18
19
+xhr.setRequestHeader('User-Agent', 'Search bot'); //set forbidden header
20
+xhr.send();
0 commit comments