我在SQL Server 2014中具有Web服务。我正在使用sp_oamethod
请求API。现在,我得到响应代码和响应主体。我需要获取响应头。谁能帮我吗?
以下内容可帮助我从响应头中检索Rate-Limit-Remaining
DECLARE @responseHeader varchar(4000)
EXEC sp_OAMethod @res, 'getResponseHeader', @responseHeader OUT, 'Rate-Limit-Remaining'
PRINT 'Rate-Limit-Remaining: ' + coalesce(@responseHeader,'<null>')
EXEC sp_OAMethod @res, 'getResponseHeader', @responseHeader OUT, 'Rate-Limit-Reset'
PRINT 'Rate-Limit-Reset: ' + coalesce(@responseHeader,'<null>')
EXEC sp_OAMethod @res, 'getAllResponseHeaders', @responseHeader OUT
PRINT 'Response Headers: ' + coalesce(@responseHeader,'<null>')