mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-29 08:17:51 -04:00
add license, move folders
This commit is contained in:
parent
185cc74060
commit
271c4a46a1
132 changed files with 21 additions and 0 deletions
19
app/scripts/api/backend.gd
Normal file
19
app/scripts/api/backend.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Node
|
||||
#class_name Backend
|
||||
|
||||
|
||||
func request(url: String, callback: Callable,
|
||||
body: Dictionary = {}, method: int = HTTPClient.METHOD_GET) -> Error:
|
||||
var data = JSON.stringify(body)
|
||||
var headers = []
|
||||
|
||||
var http = HTTPRequest.new()
|
||||
http.use_threads = true
|
||||
add_child(http)
|
||||
|
||||
var err = http.request(url, headers, method, data)
|
||||
var res = await http.request_completed
|
||||
callback.call(res[0], res[1], res[2], res[3])
|
||||
remove_child(http)
|
||||
|
||||
return err
|
Loading…
Add table
Add a link
Reference in a new issue