TD-66 CodeCleanup
This commit is contained in:
parent
70cb3b5923
commit
ba6fa4193b
1 changed files with 2 additions and 25 deletions
|
@ -5,43 +5,20 @@ var password = ""
|
|||
var url: String = "http://localhost:8080/api/v1/player/login"
|
||||
var headers = ["Content-Type: application/json"]
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_username_input_text_changed(new_text: String) -> void:
|
||||
username = new_text
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func _on_password_input_text_changed(new_text: String) -> void:
|
||||
password = new_text
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func _on_button_button_up() -> void:
|
||||
var loginData = {"username": username, "password": password}
|
||||
var json = JSON.stringify(loginData)
|
||||
|
||||
print(username)
|
||||
print(password)
|
||||
#$HTTPRequest.request("https://catfact.ninja/fact")
|
||||
$HTTPRequest.request(url, headers, HTTPClient.METHOD_POST, json)
|
||||
print(json)
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
print(body.get_string_from_utf8())
|
||||
|
|
Loading…
Add table
Reference in a new issue