HTTPSocket
Class HTTPSocket

Method PrototypeDescription
Sub AuthenticationName( Assigns newValue As String )set username for servers that require authentication
Function AuthenticationName() As Stringget username for servers that require authentication

Sub AuthenticationPassword( Assigns newValue As String )set password for servers that require authentication
Function AuthenticationPassword() As Stringget password for servers that require authentication

Sub ClearRequestHeaders()remove all InternetHeaders set by SetRequestHeader

Sub Constructor()initialize with default options

Function EncodeFormData( formData As Dictionary ) As Stringget form data as URL-encoded string

Function Error() As Booleanget the last error state
Function ErrorCode() As Integerget the last error code

Function Get( url As String ) As Booleanperform an HTTP GET, often used to retrieve data from an HTTP server

Sub HTTPProxyAddress( Assigns newValue As String )set the address of the HTTP proxy server
Function HTTPProxyAddress() As Stringget the address of the HTTP proxy server

Sub HTTPProxyPort( Assigns newValue As Integer )set the port of the HTTP proxy server
Function HTTPProxyPort() As Integerget the port of the HTTP proxy server

Function HTTPStatusCode() As Integerget the current HTTP status code

Function Post( url As String ) As Booleanperform an HTTP POST, often used to send data to an HTTP server

Function Reply() As Stringget the response from the HTTP server

Sub SetFormData( formData As Dictionary )use specified Dictionary to populate names and values of form data to be posted

Sub SetPostContent( content As String, contentType As String )set the content type and data to be sent with a POST

Sub SetRequestHeader( name As String, value As String )set the value of the specified InternetHeader

Sub Timeout( Assigns newValue As Integer )set the timeout (in seconds). The maximum is 30 seconds.
Function Timeout() As Integerget the timeout (in seconds). The default is 20 seconds.


The HTTPSecureSocket class is used to send a request to an HTTP server and retrieve the response. Both POST and GET methods are supported. Form data can be posted using a Dictionary and the SetFormData method. Or, raw post content can be set using SetPostContent.

See HTTPSecureSocket for making HTTP connections using a secure (SSL) connection.