- beta 2 is out ! It tooks some time but we come back with the usual bug fixes and some new commands:
- HTTPRequest() and HTTPRequestMemory() to call REST api easily (sponsored by c-wayne)
- UseMySQLDatabase() which use the opensource libmariadb.dll (found in purebasic\compilers\ dir) and brings MySQL and MariaDB support natively to PureBasic ! (sponsored by Paul)
- MaterialTextureAliases() which allow to bind a PureBasic texture to an alias for use in a script.
Example for new HTTPRequest() command:
For UseMySQLDatabase(), the OpenDatabase() command must be used like that:
- HTTPRequest() and HTTPRequestMemory() to call REST api easily (sponsored by c-wayne)
- UseMySQLDatabase() which use the opensource libmariadb.dll (found in purebasic\compilers\ dir) and brings MySQL and MariaDB support natively to PureBasic ! (sponsored by Paul)
- MaterialTextureAliases() which allow to bind a PureBasic texture to an alias for use in a script.
Example for new HTTPRequest() command:
Code : | Sélectionner tout |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 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 |
Code : | Sélectionner tout |
db = OpenDatabase(#PB_Any, "host=localhost port=3306 dbname=yourdb", User$, Pass$)