Sample code for 30+ languages & platforms
SQL Server

Example: Rest.AddHeader method

Demonstrates the AddHeader method.

Chilkat SQL Server Downloads

SQL Server
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @rest int
    EXEC @hr = sp_OACreate 'Chilkat.Rest', @rest OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int
    EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'User-Agent', 'MyApplication/1.0'

    -- ...
    -- ...
    -- ...

    EXEC @hr = sp_OADestroy @rest


END
GO