title: Unexpected error occurred running a simple unauthorized Rest query
body: <p>I have a rest endpoint that doesn't perform an authentication check. I can run a simple curl commmand from Linux:</p>
  
  <pre><code>curl -k https://application/api/about
  </code></pre>
  
  <p>This responds.</p>
  
  <p>However if try the following on PowerShell it fails:</p>
  
  <pre><code>Invoke-RestMethod https://application/api/about
  </code></pre>
  
  <p>Then I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
  At line:1 char:1
  + Invoke-RestMethod $Application
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
  </code></pre>
  
  <p>Could some one please tell me how I can get around this problem ?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Trying with Invoke-WebRequest:</p>
  
  <pre><code>Invoke-WebRequest -Uri "https://application/api/about"
  </code></pre>
  
  <blockquote>
    <p>Invoke-WebRequest : The underlying connection was closed: An
    unexpected error occurred on a send. At line:1 char:1
    + Invoke-WebRequest -Uri "<a href="https://application/api/a" rel="noreferrer">https://application/api/a</a> ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest],
    WebException
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand</p>
  </blockquote>