This commit is contained in:
Torsten 2024-12-22 12:24:50 +01:00
parent d16160323c
commit 1e22d28754
34 changed files with 708 additions and 1822 deletions

View file

@ -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]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB