Notice the shell is removing the quotes around the computername (read the “Query Resource=” part of the response). You need to either URL-encode the query, or put the query in a file and call it from there (which is how I handle it with curl.exe, not sure whether iem has an option to read the query from a file).
Have a look at How to get CPU cores from REST API?