Connects to server, given a URL to that server. The URL may also specify a particular resource on the server, in which case, a handle to that resource is returned.
Synopsis
error = InetConnectUrl(url, variableName, flags, extra)
Args
url is a string containing the URL to the server/resource, for example http://www.borg.com/~jglatt/rexx/rexxuser.htm to access the REXX User's web page (on the server containing that page) or http://www.microsoft.com to access Microsoft's server.
variableName is the name of some REXX variable that you wish to be set to a server handle (or the resource itself if using the DOWNLOAD option) that InetConnectUrl creates for you. You do not need to know the details of what a server handle is, but you need to pass this server handle to InetClose after you've finished all communication with this server.
flags specifies some options. It may be any of the following, each separated by a | character:
Value | Meaning |
---|---|
DOWNLOAD | Downloads the resource and stores it in the variable variableName. The server handle is automatically closed after download. |
REUSE | Attempt to use an existing handle from InetConnect if one exists with the same attributes. This is useful only with FTP operations, since FTP is the only protocol that typically performs multiple operations in the same session. |
LINK | Force a reload if there's no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network. |
NOHOSTCHECK | Disable checking of SSL/PCT-based certificates that are returned from the server against the host name in the URL. RexxINet functions use a simple check against certificates by comparing for matching host names and simple wildcarding rules. |
NODATECHECK | Disable checking of SSL/PCT-based certificates for proper validity dates. |
HTTP | Transparently allow redirects from HTTPS to HTTP URLs. |
HTTPS | Transparently allow redirects from HTTP to HTTPS URLs. |
KEEPALIVE | Uses keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NTLM, and other types of authentication. |
USETEMP | Cause a temporary file to be created if the file can't be cached. |
NOAUTH | Don't attempt authentication automatically. |
NOREDIRECT | Don't automatically handle redirection when you call InetSendHttpRequest. |
NOCACHEWRITE | Don't add the returned web page or file to the cache. |
NOCOOKIES | Don't automatically add cookie headers to requests, and don't automatically add returned cookies to the cookie database. |
NOUI | Disable the cookie dialog box. |
PASSIVE | Use passive FTP semantics for FTP files and directories. |
NOCACHE | Force the request to be resolved by the origin server, even if a cached copy exists on the proxy. |
RAWDATA | Return the data as a GOPHER_FIND_DATA structure when retrieving Gopher directory information, or as a WIN32_FIND_DATA structure when retrieving FTP directory information. If this flag is not specified or if the call was made through a CERN proxy, InetConnectUrl returns the HTML version of the directory. |
RELOAD | Force a download of the requested file, object, or directory listing from the origin server, not from the cache. |
RESYNC | Reload HTTP resources if the resource has been modified since the last time it was downloaded. All FTP and Gopher resources are reloaded. |
SECURE | Use secure transaction semantics. This uses Secure Sockets Layer/Private Communications Technology (SSL/PCT) and is only meaningful in HTTP requests. |
If omitted, flags defaults to none of the above.
extra is some string containing extra HTTP headers to be sent as soon as connection is made to the server. Omit this if no such headers need to be sent.
Returns
An empty string if successful, or an error message if a problem.
Notes
If you call InetConnectUrl() before calling InetOpen() to initialize RexxInet, then a REXX SYNTAX condition is raised. CONDITION('E') returns error number 40.1 and CONDITION('D') returns the message DLL function "INETCONNECTURL" reported session handle not open!.