...
This commit is contained in:
parent
1e22d28754
commit
6b926d3afe
126 changed files with 128562 additions and 104297 deletions
|
|
@ -0,0 +1,18 @@
|
|||
```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]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue