diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-04 23:36:49 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-04 23:36:49 +0100 |
commit | 25b78dfa6ed9da1f918d731ae8da9469d7b65a26 (patch) | |
tree | 18f5d4fc4a51f2d919f5a8c56e39706138b165e7 /devtools/client/netmonitor/test/html_curl-utils.html | |
parent | f6e7a511bc39106c1bb0f9461d1eb23564c10c8b (diff) | |
download | uxp-25b78dfa6ed9da1f918d731ae8da9469d7b65a26.tar.gz |
Copy as cURL (PATCH)
Issue #44
Diffstat (limited to 'devtools/client/netmonitor/test/html_curl-utils.html')
-rw-r--r-- | devtools/client/netmonitor/test/html_curl-utils.html | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/devtools/client/netmonitor/test/html_curl-utils.html b/devtools/client/netmonitor/test/html_curl-utils.html index 8ff7ecdf0d..eb5c0c5b6b 100644 --- a/devtools/client/netmonitor/test/html_curl-utils.html +++ b/devtools/client/netmonitor/test/html_curl-utils.html @@ -52,6 +52,17 @@ xhr.send(params); } + function ajaxPatch(aUrl, aCallback) { + let xhr = new XMLHttpRequest(); + xhr.open("PATCH", aUrl, true); + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xhr.onload = function() { + aCallback(); + }; + var params = "param1=value1¶m2=value2¶m3=value3"; + xhr.send(params); + } + function ajaxMultipart(aUrl, aCallback) { var xhr = new XMLHttpRequest(); xhr.open("POST", aUrl, true); @@ -88,8 +99,10 @@ function performRequests(aUrl) { ajaxGet(aUrl, () => { ajaxPost(aUrl, () => { - ajaxMultipart(aUrl, () => { - submitForm(); + ajaxPatch(aUrl, () => { + ajaxMultipart(aUrl, () => { + submitForm(); + }); }); }); }); |