Explorar o código

Merge pull request #62370 from timothyqiu/http-request-doc-3.x

[3.x] Make code example in HTTPRequest classref working
Rémi Verschelde %!s(int64=3) %!d(string=hai) anos
pai
achega
f428bfd456
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      doc/classes/HTTPRequest.xml

+ 1 - 1
doc/classes/HTTPRequest.xml

@@ -23,7 +23,7 @@
 		    # Perform a POST request. The URL below returns JSON as of writing.
 		    # Note: Don't make simultaneous requests using a single HTTPRequest node.
 		    # The snippet below is provided for reference only.
-		    var body = {"name": "Godette"}
+		    var body = to_json({"name": "Godette"})
 		    error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body)
 		    if error != OK:
 		        push_error("An error occurred in the HTTP request.")