Code: Select all
' HTTP example will wait up to 5 seconds for a SYNC then wait up to 5 seconds for a response
' During this time your basic program will not respond
DIM A$(256)
' Build a request string, could also be a POST, could also include CGI
A$ = sprintf("GET /%c%c%c%c",13,10,13,10)
'Example read a local page server
HTTP ((192<<24)+(168<<16)+(1<<8)+4, A$)
' Another way to builod the string
'HTTP ((192<<24)+(168<<16)+(1<<8)+4, "GET /" + chr(13) + chr(10) + chr(13) + chr(10) )
'up to 256 bytes of response are returned in the CGI buffer
'headers are stripped so only page text is returned
'sit and listen up to 5 seconds for any incoming HTTP response
A$=""
START = TIMER
WHILE A$(0) = 0 and TIMER-START < 5000000
A$ = CGIIN
LOOP
PRINT " read "; LEN(A$); " bytes"
printf("%s", A$)
To use this update the ARMweb with the attached firmware