unfortunately, the http commands are borked, last I checked.
The idea though is you send an http request to a server, the server brings it back to dbp, and it saves out to a temporary file that you can later parse.
Here's some functions I created that make the process actually work, on http or https protocol.
function download(from$,to$)
//the built-in dbp functions don't work, but this does
//what it does is deletes the existing file that may have been previously downloaded
//then it deletes the cache file so you don't keep getting the same file that may have since changed
//then it downloads the file from the server
if file exist(to$) then delete file to$
load dll "urlmon",1
LOAD DLL "wininet",2
failed_delete_cache = CALL DLL(2,"DeleteUrlCacheEntryA", from$)
failed=CALL DLL(1,"URLDownloadToFileA",0,from$,to$,0,0)
delete dll 2
delete dll 1
endfunction failed
//This function takes text and converts it to valid
//url characters. This function does not do any
//security checks. In general you would only run user input
//through this function to pass along in a URL. Eg:
// return$ = "http://www.domain.com/index.php?var=" + url_encode(user_input$)
FUNCTION url_encode(string_to_encode AS STRING)
string_output AS STRING = ""
char_str AS STRING = ""
hex_code AS STRING = ""
FOR char = 1 TO LEN(string_to_encode)
char_str = MID$(string_to_encode,char)
ascii_code = ASC(char_str)
IF (ascii_code =< 32) OR (ascii_code => 159 AND ascii_code =< 191) OR (ascii_code => 159) OR (ascii_code => 34 AND ascii_code =< 38) OR ascii_code = 43 OR ascii_code = 44 OR ascii_code = 47 OR (ascii_code => 58 AND ascii_code =< 64) OR (ascii_code => 91 AND ascii_code =< 94) OR ascii_code = 96 OR (ascii_code => 123 AND ascii_code =< 126)
hex_code = RIGHT$(HEX$(ascii_code),2) //2 digits only!
string_output = string_output + "%" + hex_code
ELSE
string_output = string_output + char_str
ENDIF
NEXT char
ENDFUNCTION string_output
More info about these functions can be found here:
http://forum.thegamecreators.com/?m=forum_view&t=180318&b=6
http://forum.thegamecreators.com/?m=forum_view&t=172394&b=1