...
This commit is contained in:
parent
c1c5541ccd
commit
08ed389c8a
16 changed files with 1216 additions and 34421 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,19 +0,0 @@
|
|||
```python
|
||||
extends Control
|
||||
|
||||
@onready var http_request: HTTPRequest = $btn_login/HTTPRequest
|
||||
@onready var te_result: TextEdit = $te_result
|
||||
|
||||
var url = "https://meowfacts.herokuapp.com/"
|
||||
|
||||
func _on_btn_login_button_up() -> void:
|
||||
var headers = ["Content-Type: application/json"]
|
||||
http_request.request(url, headers, HTTPClient.Method.METHOD_GET)
|
||||
|
||||
func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
var data = JSON.parse_string(body.get_string_from_utf8())
|
||||
te_result.text = data.data[0]
|
||||
```
|
||||
|
||||
![[Pasted image 20241222121529.png]]
|
||||
|
||||
|
|
@ -30,4 +30,6 @@ func _on_http_request_request_completed(result: int, response_code: int, headers
|
|||
var token:String = data.data.token
|
||||
te_result.text = "token: " + token
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
![[Pasted image 20241222121529.png]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue