浏览代码

Make code example in HTTPRequest classref working

Haoyu Qiu 3 年之前
父节点
当前提交
c31ce5be02
共有 1 个文件被更改,包括 1 次插入1 次删除
  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.")