8

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.

mklement0
  • 382,024
  • 64
  • 607
  • 775
nobrac
  • 372
  • 1
  • 6
  • 16

1 Answers1

-4

-Body parameter works with the payload

nobrac
  • 372
  • 1
  • 6
  • 16
  • 3
    Please flesh this out in more detail to help future readers, including explaining what specific escape characters you had to use. – mklement0 Oct 03 '18 at 00:30