(SQL Server) User-Agent Header Field in HTTP Requests
The User-Agent header is an HTTP request header that identifies the client software (e.g., web browser, API client, bot, or script) making the request to a server. It provides information about the software, version, and operating system.
This example shows how to set the User-Agent header field.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
EXEC sp_OASetProperty @http, 'UserAgent', 'MyApp/3.0'
-- ...
-- ..
EXEC @hr = sp_OADestroy @http
END
GO
|