diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
| commit | 2bb2ff871fa1761478442bec5f6a32c9428360a1 (patch) | |
| tree | 9b73df7a0c50c02353ae7bca7c2cd54788ef0077 /examples/http | |
| parent | 59845e610f2c90474f34079d27b5f1e07071ded4 (diff) | |
Change method calls to use `foo.baz()` instead of `foo:baz()`
Diffstat (limited to 'examples/http')
| -rw-r--r-- | examples/http/http.tm | 6 |
1 files changed, 3 insertions, 3 deletions
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) |
