title: How to call .net core web api using Sql server?
body: <p>How to call .net core Web API in sql server?</p>
  
  <p>I tried below then i  getting "0x800C0005", "The system cannot locate the resource specified."</p>
  
  <pre><code>DECLARE @Object AS INT ;
  DECLARE @hResult INT
  DECLARE @Url AS VARCHAR(1000) ;
  declare @statusText varchar(1000), @status varchar(1000), @ResponseText AS VARCHAR(8000) ;
  SET @Url = 'https://myhost.com/path/to/whatever/'
  
  EXEC sp_OACreate 'MSXML2.XMLHTTP', @Object OUT ; --
  EXEC sp_OAMethod @Object, 'open', NULL, 'get', @Url,'false'
  EXEC sp_OAMethod @Object, 'setRequestHeader', NULL, 'Content-type', 'application/json';
  
  EXEC @hResult = sp_OAMethod @Object, 'send';
  
  exec sp_OAGetProperty @Object, 'StatusText', @statusText out
  exec sp_OAGetProperty @Object, 'Status', @status out
  EXEC sp_OAGetProperty @Object, 'responseText', @ResponseText OUTPUT
  </code></pre>