Port

Sets or retrieves the port of the HTTP server to connect to.

Syntax

HTTPObject.Port

Where:

  • Port is a String (read/write)
Example

This script will re-use the same Object to connect to a different port and Send the same request:

Function Main

Dim HTTPObj as Object

ip = "127.0.0.1"

port1 = 80

port2 = 81

cr = Chr(13) + Chr(10)

Set HTTPobj = HTTP.Connect (ip,port1)

' Set up the request type

HTTPobj.GetURL("/")

'to pass through the proxy with automatic authentication

'Authentication needs to be set to 1

HTTPobj.Authentication = 1

'Send the GET request

HTTPResponse1 = HTTPobj.SendRequest ()

HTTPobj.PORT = port2

HTTPResponse2 = HTTPobj.SendRequest ()

echo "Result: " + cstr(HTTPResponse1)+cr

echo "Result: " + cstr(HTTPResponse2)+cr

End Function