You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, a Library bundle with more example scripts is available in the download section as well.
17
17
18
18
# About TeaScript
19
-
**What is new in TeaScript 0.14.0?** TeaScript 0.14 comes with the Tea StackVM, a Compiler, Dis-/Assembler, Suspend+Continue, Yield, improved debugging and more.<br>
19
+
**What is new in TeaScript 0.15.0?** TeaScript 0.15 comes with a Web Server / Web Client module preview, full JSON read/write support and more.<br>
20
20
<br>Get all infos in the **latest news** article:<br>
- (automatically) **compile** and **execute** TeaScript files in the new **integrated Tea StackVM**.
25
-
-**Save** and **Load** compiled TeaScript programs as TeaScript Binary files (*.tsb).
26
-
-**Suspend** and **Continue** TeaScript programs at (nearly) any time by either themselves, by maximum time or instruction constraint or by an external request from another thread.
27
-
- Use TeaScript code similar like a **coroutine** in your C++ Application by yielding values from any place and **co-operative / preemptive execution** possibilities.
28
-
- Nerd feature: program directly in TeaScript **Assembly**.
29
-
- improved debugging capabilities with single stepping, view the callstack, view corresponding source code and more.
30
-
- Opt-out header only library for save includes and compile time
24
+
-**Web module** as a preview for **http client / server** functionality with enhanced build-in **JSON** support.
25
+
- Full **JSON** support for read and write operations (String/File ⟷ (Named) Tuple).
26
+
- Provided C++ JSON adapter for nlohmann::json, RapidJSON, Boost.Json and PicoJson.
27
+
- Added missing write support for TOML (now TOML is complete as well).
28
+
- Import/export of C++ JSON / TOML objects from/to ValueObject of TeaScript (as a Named Tuple)
29
+
30
+
## Example HTTP GET
31
+
```cpp
32
+
// issue a http GET request (here to a test page for JSON as payload)
33
+
def reply := web_get( "headers.jsontest.com" )
34
+
35
+
// access http status code and its reason (may print "200: OK")
36
+
println( reply.code % ": " % reply.reason )
37
+
38
+
// print all header entries of the reply
39
+
tuple_print( reply.header, "header", 1 )
40
+
41
+
// the above may print:
42
+
// [...]
43
+
// header.Date: "Sat, 31 Aug 2024 13:34:26 GMT"
44
+
// header.Server: "Google Frontend"
45
+
// header.Content-Length: "236"
46
+
47
+
// If the payload was sent as Content-Type "application/json" TeaScript automatically builds a Tuple out of it.
48
+
// Then all elements/objects can be accessed directly. In this example the server just echoed the header of
49
+
// the request back as a json formatted string and TeaScript created a Json compatible Tuple from it:
50
+
51
+
// print the Host value
52
+
println( reply.json.Host )
53
+
// print the User-Agent
54
+
println( reply.json["User-Agent"] )
55
+
// dot access possible as well!
56
+
println( reply.json."User-Agent" )
57
+
```
31
58
32
59
## General information
33
60
Get a very nice overview with the most **impressive highlights** here:<br>
0 commit comments