Files
Claro/docs/V1_17_NETWORKING.md
T

1.6 KiB

Claro v1.17.26 Networking Reliability

Claro v1.17.26 hardens the beginner networking foundation without making the language harder to read.

The goal is simple plain-text commands:

HTTP GET "claro://hello" AS page
SAY page

Offline-safe learning URLs

Claro includes built-in claro:// network test URLs. These do not need the internet, so lessons and tests work offline.

HTTP GET "claro://hello" AS page STATUS status
SAY page
SAY status

Expected output:

Hello from Claro networking.
200

Available built-in test URLs:

claro://hello
claro://json
claro://empty
claro://missing

Check a URL

HTTP CHECK "claro://hello" AS safe
SAY safe

This returns YES for safe http://, https://, or claro:// URLs and NO for unsafe strings.

Get a page

HTTP GET "claro://hello" AS page
SAY page

To also store the status code:

HTTP GET "claro://hello" AS page STATUS status
SAY status

Claro also stores the latest HTTP status in:

LASTHTTP

Get only the status

HTTP STATUS "claro://hello" AS code
SAY code

Save a response to a file

HTTP SAVE "claro://json" TO "data.json" AS code
SAY code

Safety rules

Claro accepts only simple, safe network URL forms:

http://...
https://...
claro://...

Dangerous shell characters are rejected before calling external tools. This keeps the command beginner-friendly and safer.

Real http:// and https:// requests use curl when available. The claro:// URLs always work offline.