If I have a curl
command such as:
curl <url> \
-H 'Content-Type: application/json' \
-H 'API-Key: <key>' \
--data-binary '{"blah":"blah {\n blah2(accountId: id, integrations: {int1: {Vms: [{Id: id2, resourceGroups: [\"test1\", \"test2\", \"test3\"]}]}}) {\n integrations {\n id\n name\n service {\n id\n slug\n }\n }\n }\n}\n", "variables":""}'
What would be the equivalent to --data-binary
within Powershell? Some answer stated just running curl.exe
, others mentioned to change the content-type. This does work as a shell script fine though. Just wondering if its possible to convert it to use Invoke-WebRequest
within Powershell.
Invoke-RestMethod
orInvoke-WebRequest
with the-InFile
parameter. – Lavinia--data-binary
– Enchain-Body
parameter. – Lavinia-Body
parameter seems to not care about being binary or not- works as expected, though it does require specific escape characters- thanks for the feedback! – Enchain