Merge pull request #2155 from eska014/html5-3.1

Update web platform docs
This commit is contained in:
Rémi Verschelde
2019-01-26 21:04:33 +01:00
committed by GitHub
7 changed files with 464 additions and 302 deletions

View File

@@ -51,7 +51,12 @@ It will connect and fetch a website.
# Keep polling for as long as the request is being processed.
http.poll()
print("Requesting...")
OS.delay_msec(500)
if not OS.has_feature("web"):
OS.delay_msec(500)
else:
# Synchronous HTTP requests are not supported on the web,
# so wait for the next main loop iteration.
yield(Engine.get_main_loop(), "idle_frame")
assert(http.get_status() == HTTPClient.STATUS_BODY or http.get_status() == HTTPClient.STATUS_CONNECTED) # Make sure request finished well.