Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) Explaining the Path Part of a URLThe general URL syntax is based on this format: <scheme>://<host>:<port>/<path>?<query>#<frag> Note: We've left out a few less commonly used parts, such as username/password and params that are not query params. The path part of a URL is the local name for a resource on a server. When an HTTP request is going to be sent to "www.something.com", the HTTP client must first resolve the domain name to an IP address. It then establishes the connection to that IP address, potentially negotiating an SSL/TLS secure channel if the scheme is "https". The HTTP request is then sent over the connection. However, a given IP address could host many websites. It is the HOST header within the HTTP request header that allows the server to direct the request to the correct website. At this point, it is the path part of the URL that is used to locate the resource within the website.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) DECLARE @req int -- Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.HttpRequest', @req OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END -- An HTTP request object can be loaded from a full URL. EXEC sp_OAMethod @req, 'SetFromUrl', NULL, 'https://www.youtube.com/watch?v=fAZdTchQePc&t=45s' -- This Path property is set to the path part of the URL (including the starting "/" char). -- In this case, the path will be "/watch" EXEC sp_OAGetProperty @req, 'Path', @sTmp0 OUT PRINT 'path = ' + @sTmp0 EXEC @hr = sp_OADestroy @req END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.