Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Retrieving a plain text value over HTTP

Author
Message
roswell1329
14
Years of Service
User Offline
Joined: 12th Apr 2010
Location:
Posted: 6th Mar 2017 22:14
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:



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?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 6th Mar 2017 22:33 Edited at: 6th Mar 2017 22:34
Stumped. Your code looks okay to me. SendHTTPRequest looks like it's waiting for the server response, but GetHTTPResponse doesn't return a value. Maybe a bug.

The Async version works though:

roswell1329
14
Years of Service
User Offline
Joined: 12th Apr 2010
Location:
Posted: 7th Mar 2017 13:14
Ah, good. Thanks for confirming that it wasn't just me! And thanks for the alternative solution!
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Mar 2017 16:36
For SendHTTPRequest the response is returned directly from the function call. The following should work

Login to post a reply

Server time is: 2024-11-24 19:41:46
Your offset time is: 2024-11-24 19:41:46