zombie
zombie copied to clipboard
TypeError: Cannot include body with GET/HEAD request
trying to figure out this message I get it for all my GET requests
here's my request:
GET /api/v2/mng-ui/external-connections HTTP/1.1 Host: 127.0.0.1:8080 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache X-CSRF-Token: 64a4b0b9-6fe4-4bad-95d1-1b2dabdf55d4 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Content-Type: application/json; charset=UTF-8 Accept: / Referer: http://127.0.0.1:8080/console/ Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.8,he;q=0.6 Cookie: tsAdminSessionId=92ec2331-b914-42a4-a27c-828773dcae3c
zombie XHR readystatechange http://127.0.0.1:8080/api/v2/mng-ui/external-connections +167ms
TypeError: Cannot include body with GET/HEAD request
at new Request (/Users/drorrash/work/projects/integration-tests/node_modules/zombie/lib/fetch.js:452:56)
at XMLHttpRequest.send (/Users/drorrash/work/projects/integration-tests/node_modules/zombie/lib/xhr.js:131:21)
at http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:50377
at $ (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:48317)
at c (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:46960)
at s (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:64875)
at http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:65047
at p.$eval (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:72548)
at p.$digest (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:71056)
at t.$apply (http://127.0.0.1:8080/console/vendor.475d3bbc82ca28b5a4bc.js:6:72831)
at core.(anonymous function).
I think I figured it out, why does GET requests with an empty body are rejected?
referring to line 451 @fetch.js if (init && init.body) { if (method === 'GET' || method === 'HEAD') throw new TypeError('Cannot include body with GET/HEAD request'); bodyInit = init.body; }