Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm new in calling API, I can't find the reason this command in powershell raise an error
$hdrs = @{} $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'} $Body = @{ $url = "https://XXXXX.XXXXXX.XXX:4242/qrs/app/import?name=test_import&xrfkey=1234567890123456" |
Error:
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At line:15 char:13
+ $response = Invoke-RestMethod -Uri $url -Method POST -Headers $hdrs - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
PS: I can run other POST or Get command
@parviz_asoodehfard have you tried this?
The usage of power shell was a POC for me. After that, I need to run it by PDI and the base thing is enough for me, so I didn't try Qlik-CLI.
I found out I should use qrs/app/update.
I appreciate you @andoryuu
Gotcha - glad it all worked out!