Skip to content

Improvements in HTTP slots

Compare
Choose a tag to compare
@polterguy polterguy released this 23 Nov 08:50
· 4269 commits to master since this release

This release features automatic conversion from Lambda to JSON when invoking [http.post], [http.patch] and [http.put], significantly simplifying invoking HTTP endpoints requiring a [payload] argument. Example usage can be found below.

http.post:"https://jsonplaceholder.typicode.com/posts"
   payload
      userId:int:1
      id:int:1

In addition to the above simplifications, and expressions within your payload lambda will automatically be evaluated and [unwrap]'ed, such as the following illustrates.

.userId:int:1
http.post:"https://jsonplaceholder.typicode.com/posts"
   payload
      userId:x:@.userId
      id:int:1

In addition to the above change, a Hyperlambda HTTP endpoint can now explicitly declare no type checking for its [.arguments] collection using the following syntax.

.arguments:*

Notice the asterisk in the above [.arguments] node, which functions similarly to simply omitting the [.arguments] collection entirely, providing a slightly more semantically "correct" method to bypass type checking and argument conversions.