Is it possible for TestRunner API without cURL using PowerShell Invoke Method
Trying to avoid running cURL commands in our architecture. Is it possible for TestRunner API without cURL using PowerShell Invoke Method
I seem to be haveing difficulty here is the psude code I am trying to execute...
PS C:\Users\%USER%> Invoke-RestMethod -Method POST -ContentType "application/json" -uri "http://localhost:1880/1/suites" -Body @C:\source\apiTest.zip
Invoke-RestMethod : {"success":false,"errorMessage":"The specified data is not a valid ZIP file."}
At line:1 char:1
+ Invoke-RestMethod -Method POST -ContentType "application/json" -uri " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Multipart/form-data does work when adding as content type. The problem I had here is the API needed some parameters to accept raw content, then I was able to use -InFile \path\to\file and upload using Invoke-RestMethod subway gift card balance