I just ran a test and it was successful.
I set up a test place on one of my sites: www.thetrilobyte.com/agktest
It is username/password protected using htaccess.
The initial test failed when I used the IP address for the domain (and it is a fixed IP address). But when I used the domain name, it worked.
I was able to test in the non-secure mode only, so far. I discovered, much to my embarrassment, that I had somehow managed to not renew the SSL certificate last year. I just started the process to renew it and it might take a bit (they created a new ticket system and seem to be a little slow at the moment).
The following code works and you can test with it:
// create the connection
httpcon = CreateHTTPConnection()
// connect to the host and pass user name and password
host = SetHTTPHost(httpcon,"www.thetrilobyte.com",0,"agktest","pw_agktest")
// start the request
req = SendHTTPRequestASync(httpcon,"/agktest/newmessage.php","u=sometexttopost")
// set up for timeout
tR = GetMilliseconds() + 10000
timeout = 0
// start checking
repeat
// check for timeout
if GetMilliseconds()> tR then timeout = 1
// show doing something
Print("Sending....")
// update display
Sync()
until (timeout = 1) or (GetHTTPResponseReady(httpcon) = 1)
// one more update
Print("Finished sending.")
Sync()
// check for timeout
if timeout = 1
// display timeout message
Message("failed to send message to server - timeout")
else
// get the response
resp$ = GetHTTPResponse(httpcon)
// display it
Message(resp$)
endif
// close the connection
CloseHttpConnection(httpcon)
Upon success, the message (using plain http) is:
Quote: "Connected using 'http'. Received 'sometexttopost' as data."
If you change "u=sometexttopost" to anything other than something starting with "u=", the message returned is:
Quote: "Connected using 'http'. Did not get passed data."
Once I get the SSL certificate back in place, I will test with an https connection and see if it works.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master