MIGetHttpConnection() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Establishes an HTTP connection and gets a handle to a CHttpConnection object.

Syntax

MIGetHttpConnection( ByVal hSession As CInternetSession, 
	ByVal strServer As String, ByVal nPort As INTERNET_PORT
	As CHttpConnection

hSession is a CinternetSession handle.

strServer is a string that contains the HTTP server name.

nPort is a number that identifies the TCP/IP port to use on the server.

Return Value

A handle to a CHttpConnection object. If the call fails, Null is returned. To determine the cause of the failure, call the MIGetErrorMessage() function.

Description

MIGetHttpConnection() connects to an HTTP server, creates and returns a handle to a CHttpConnection object. It does not perform any specific operation on the server. If you intend to query an HTTP header, for example, you must perform this operation in separate steps.

The caller has to dispose of the handle by calling the MICloseHttpConnection() procedure when the handle is no longer in use.