![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) Example: Http.HasRequestHeader methodDemonstrates the
-- 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 EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'X-CSRF-Token', 'Fetch' DECLARE @b int EXEC sp_OAMethod @http, 'HasRequestHeader', @b OUT, 'X-CSRF-Token' IF @b = 1 BEGIN PRINT 'X-CSRF-Token: Yes' END ELSE BEGIN PRINT 'X-CSRF-Token: No' END EXEC sp_OAMethod @http, 'HasRequestHeader', @b OUT, 'X-Something' IF @b = 1 BEGIN PRINT 'X-Something: Yes' END ELSE BEGIN PRINT 'X-Something: No' END -- The Accept and Accept-Encoding headers are default headers automatically added, -- unless the application chooses to remove by calling RemoveRequestHeader for each. EXEC sp_OAMethod @http, 'HasRequestHeader', @b OUT, 'Accept' IF @b = 1 BEGIN PRINT 'Accept: Yes' END ELSE BEGIN PRINT 'Accept: No' END -- Output: -- X-CSRF-Token: Yes -- X-Something: No -- Accept: Yes EXEC @hr = sp_OADestroy @http END GO |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.