I'm trying to get a single random number from the website
https://www.random.org using the following address with GET variables:
https://www.random.org/integers/?num=1&min=1&max=10000&col=5&base=10&format=plain&rnd=new
The result is a plain text single number, which I thought would be the simplest to use. I set up the following code based on the examples in the documentation:
// Project: Campanion
// Created: 2017-03-02
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Random" )
SetWindowSize( 320, 480, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 320, 480 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
// other initializations
http = CreateHTTPConnection()
SetHTTPHost( http, "www.random.org", 1 )
SendHTTPRequest( http, "integers/?num=1&min=1&max=10000&col=5&base=10&format=plain&rnd=new" )
response$ = GetHTTPResponse(http)
CloseHTTPConnection(http)
DeleteHTTPConnection(http)
do
Print( "Server Response: " + response$ )
Sync()
loop
The problem is...nothing is coming back. Nothing is printed. This seems exactly like some of the examples I read. Can anyone see what simple thing I'm missing?