wwHTTP::HTTPConnect

This low level HTTP method initiates a low level HTTP request for use with HTTPGetEx by establishing an IP Session and connecting to a target server. The main purpose of this method is to specify the server name and the security options when connecting.

Meant for internal use.

Note: Use Get(), Post(), Put(), Delete() or HttpGet() instead!
These high level functions provide all the functionality of these low level methods without all the setup and multiple method calls - there is little to no need to use them in application code - they are for internal use primarily and implement the higher level features.

o.httpconnect(lcServer, lcUsername, lcPassword, llHTTPS)

Return Value

0 on success, an API error number on failure. Check cErrorMsg for an error string.

Parameters

All parameters are optional if the appropriate property names are set.

lcServer
Domain name or IP address of the server to connect to.

Examples: www.west-wind.com, 111.111.111.111

Note: Do not specify a URL here. This parameter should not include a protocol or port! Do not use http://www.west-wind.com/sompage.htm - if you want to specify a single URL use the HTTPGet() method.

Corresponds to cServer property.

lcUsername
Optional - A username that is used for Basic Authentication on the Web server. Corresponds to cUsername property.

lcPassword
Optional - A password that is used for Basic Authentication on the Web server. Corresponds to cPassword property.

Note: In order for Basic Authentication to work on the server it must be enabled there! Make sure you test this with a browser before trying this functionality programmatically.

llHTTPS
Optional - Requests to use the SSL/HTTPS protocol to connect to the server with encryption. Note: the server must have a secure certificate installed. Corresponds to lSecureLink property.

Remarks

HTTPConnect() does not actually connect to the server - it builds a WinInet connection object only. The actual Web access doesn't occur until HTTPGetEx is actually called.

The nHTTPConnectMode property determines how the connection is created. The default is a direct connection, but you can also configure for Proxy or IE configurations.


See also:

wwIPStuff::cServer | wwIPStuff::nHTTPPort | wwIPStuff::lSecureLink | wwHTTP::nhttpconnecttype |

© West Wind Technologies, 1996-2023 • Updated: 03/28/23
Comment or report problem with topic