TD-66 CodeCleanup3.0
This commit is contained in:
parent
8c23ec64fa
commit
36dac56bba
1 changed files with 6 additions and 4 deletions
|
@ -5,6 +5,7 @@ var password = ""
|
|||
var url: String = "http://localhost:8080/api/v1/player/login"
|
||||
var headers = ["Content-Type: application/json"]
|
||||
|
||||
|
||||
func _on_username_input_text_changed(new_text: String) -> void:
|
||||
username = new_text
|
||||
|
||||
|
@ -13,12 +14,13 @@ func _on_password_input_text_changed(new_text: String) -> void:
|
|||
password = new_text
|
||||
|
||||
|
||||
|
||||
func _on_button_button_up() -> void:
|
||||
var loginData = {"username": username, "password": password}
|
||||
var json = JSON.stringify(loginData)
|
||||
$HTTPRequest.request(url, headers, HTTPClient.METHOD_POST, json)
|
||||
|
||||
|
||||
func _on_http_request_request_completed( result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
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