gdscript.core.ApiResponse.handlebars Maven / Gradle / Ivy
extends {{>partials/api_response_parent_class}}
class_name {{>partials/api_response_class_name}}
{{>partials/disclaimer_autogenerated}}
# Response wrapper provided to success callbacks
# ==============================================
#
# Holds the response metadata, its body, and the deserialized model(s), if any.
# This object is directly passed to the success callback, and in case of failure
# is injected in the error object.
#
## Headers sent back by the server
@export var headers := Dictionary()
## The HTTP response code, if any. A constant like HTTPClient.RESPONSE_XXXX
@export var code := 0
## Raw body of this response, in String form (before deserialization)
@export var body := ""
## Deserialized body (may be pretty much any type)
var data
func _to_string() -> String:
var s := "{{>partials/api_response_class_name}}"
if code:
s += " %d" % code
if body:
s += " %s" % body
return s
© 2015 - 2024 Weber Informatics LLC | Privacy Policy