I'm trying to call the Rest API using the new cmdlet, invoke-restmethod, and I'm experiencing odd connectivity errors when calling a couple of the search methods.
I'm able to successfully submit a search job using this command-let, and I get back a valid SID. When I try to retrieve the status of the SID, or the search results for the SID, I get an odd connectivity error. The syntax of the call is as follows:
invoke-restmethod -uri https://usvciwbs701:8091/services/search/jobs/<sid>; -credentials $myCredObj
I immediately get the following error returned:
> invoke-restmethod : The underlying connection was closed: An unexpected
> error occurred on a send.
> At line:1 char:1
> + invoke-restmethod -uri https://usvciwbs701.usvci001.vci.na.vwg:8089/services/sea
> ...
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : InvalidOperation:
> (System.Net.HttpWebRequest:HttpWebRequest)
> [Invoke-RestMethod], WebException
> + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
It's very odd, as I'm able to submit jobs using this commandlet, and I'm able to query all jobs, but as soon as I try to query an individual SID or it's return results, I get my connection dropped.
Additionally, when I query the SID using Curl, I get back the expected results. Is this a known issue with using Powershell to call the REST API directly, or should this work?
Any tips or troubleshooting idea's are welcomed,
Thanks
... View more