From 2bb2ff871fa1761478442bec5f6a32c9428360a1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 14:20:18 -0400 Subject: Change method calls to use `foo.baz()` instead of `foo:baz()` --- examples/http/http.tm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/http/http.tm') diff --git a/examples/http/http.tm b/examples/http/http.tm index 12d9978e..048ffaab 100644 --- a/examples/http/http.tm +++ b/examples/http/http.tm @@ -10,7 +10,7 @@ enum _Method(GET, POST, PUT, PATCH, DELETE) func _send(method:_Method, url:Text, data:Text?, headers:[Text]=[] -> HTTPResponse): chunks : @[Text] = @[] save_chunk := func(chunk:CString, size:Int64, n:Int64): - chunks:insert(inline C:Text { + chunks.insert(inline C:Text { Text$format("%.*s", _$size*_$n, _$chunk) }) return n*size @@ -79,7 +79,7 @@ func _send(method:_Method, url:Text, data:Text?, headers:[Text]=[] -> HTTPRespon curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &_$code); } - return HTTPResponse(Int(code), "":join(chunks)) + return HTTPResponse(Int(code), "".join(chunks)) func get(url:Text, headers:[Text]=[] -> HTTPResponse): return _send(GET, url, none, headers) @@ -99,7 +99,7 @@ func delete(url:Text, data:Text?=none, headers=["Content-Type: application/json" func main(): say("GET:") say(get("https://httpbin.org/get").body) - say("Waiting 1sec... + say("Waiting 1sec...") sleep(1) say("POST:") say(post("https://httpbin.org/post", `{"key": "value"}`).body) -- cgit v1.2.3