File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ class HTTPResult extends RefCounted:
1515
1616 var status_code : int ## The response status code.
1717 var headers : Dictionary ## The response headers.
18- var body : String ## The response body.
18+ var body : String ## The response body as a String.
19+ var body_raw : PackedByteArray ## The response body as a PackedByteArray.
1920 var json : Variant : ## Attempt to parse [member body] into a [Dictionary] or [Array], returns null on failure.
2021 set (v ): pass
2122 get : return JSON .parse_string (body )
@@ -33,6 +34,7 @@ class HTTPResult extends RefCounted:
3334 @warning_ignore ('unsafe_cast' ) h .status_code = a [1 ] as int
3435 @warning_ignore ('unsafe_cast' ) h .headers = _headers_to_dict (a [2 ] as PackedStringArray )
3536 @warning_ignore ('unsafe_cast' ) h .body = (a [3 ] as PackedByteArray ).get_string_from_utf8 ()
37+ @warning_ignore ('unsafe_cast' ) h .body_raw = (a [3 ] as PackedByteArray )
3638 return h
3739
3840 static func _headers_to_dict (headers_arr : PackedStringArray ) -> Dictionary :
You can’t perform that action at this time.
0 commit comments