浏览代码

Add clarification about HTTP Requests

aBARICHELLO 7 年之前
父节点
当前提交
d27a055a23
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      tutorials/networking/http_request_class.rst

+ 3 - 1
tutorials/networking/http_request_class.rst

@@ -67,5 +67,7 @@ Until now we have limited ourselves to requesting data from a server. But what i
         var query = JSON.print(data_to_send)
         # Add 'Content-Type' header:
         var headers = ["Content-Type: application/json"]
-        $HTTPRequest.request(url, headers, use_ssl, HTTPClient.METHOD_POST, query)        
+        $HTTPRequest.request(url, headers, use_ssl, HTTPClient.METHOD_POST, query)
 
+Keep in mind that you have to wait for a request to finish before sending another one. Making multiple request at once requires you to have one node per request.
+A common strategy is to create and delete HTTPRequest nodes at runtime as necessary.