mirror of https://github.com/axmolengine/axmol.git
add gzip test
This commit is contained in:
parent
97d0265e32
commit
33beab2d81
|
@ -103,9 +103,12 @@ var XHRTestLayer = cc.Layer.extend({
|
|||
streamXHREventsToLabel(xhr, statusGetLabel, responseLabel, "GET");
|
||||
// 5 seconds for timeout
|
||||
xhr.timeout = 5000;
|
||||
|
||||
|
||||
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
|
||||
|
||||
//set arguments with <URL>?xxx=xxx&yyy=yyy
|
||||
xhr.open("GET", "http://httpbin.org/get?show_env=1", true);
|
||||
xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true);
|
||||
|
||||
xhr.send();
|
||||
},
|
||||
|
||||
|
@ -127,8 +130,8 @@ var XHRTestLayer = cc.Layer.extend({
|
|||
|
||||
var xhr = cc.loader.getXMLHttpRequest();
|
||||
streamXHREventsToLabel(xhr, statusPostLabel, responseLabel, "POST");
|
||||
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
|
||||
xhr.open("POST", "http://httpbin.org/post", true);
|
||||
|
||||
xhr.open("POST", "http://httpbin.org/post");
|
||||
|
||||
//set Content-type "text/plain;charset=UTF-8" to post plain text
|
||||
xhr.setRequestHeader("Content-Type","text/plain;charset=UTF-8");
|
||||
|
|
Loading…
Reference in New Issue