Beta 2 is out, see first post for more info !
Example for new HTTPRequest() command:
Code:
InitNetwork()
; Specify the header you want for the request
;
NewMap Header$()
Header$("ContentType") = "octectstream"
Header$("UserAgent") = "Firefox 54.0"
Header$("NoParamHeader") = "" ; When putting no string value, it will an empty parameter
; Various http request type
; #PB_HTTP_Get - post data will be ignored
; #PB_HTTP_Post - post data will be used if specified
; #PB_HTTP_Put - post data will be used if specified
; #PB_HTTP_Patch - post data will be used if specified
; #PB_HTTP_Delete - post data will be used if specified
; Example for a POST request with string post data (will return page not found)
;
HttpRequest = HTTPRequest(#PB_HTTP_Post, "https://purebasic.com/action.php", "{ JSON: [Hello] }", 0, Header$())
If HttpRequest
Debug "ErrorCode = "+ HTTPInfo(HTTPRequest, #PB_HTTP_ErrorCode)
Debug "Response = " + HTTPInfo(HTTPRequest, #PB_HTTP_Response)
; Even in NoAsynchronous mode, FinishHTTP() must be called
FinishHTTP(HttpRequest)
Else
Debug "Failed"
EndIf
For UseMySQLDatabase(), the OpenDatabase() command must be used like that:
Code:
db = OpenDatabase(#PB_Any, "host=localhost port=3306 dbname=yourdb", User$, Pass$)