Commit Graph
6 Commits
Author SHA1 Message Date
Wez Furlong 0c70ab2c52 improve error message when converting lua -> rust types
refs: https://github.com/KumoCorp/kumomta/issues/56
2023-06-14 20:14:14 -07:00
Wez Furlong 3d6aa1a49d use rustls for reqwest http client
This is a bit of a PITA.

In the docker build we end up with some bad linkage on libssl.so.1.1
on Ubuntu. That is the legacy ssl library, to which we should not
have been able to link, and for which there are no apt installable
sources.

See
<https://askubuntu.com/questions/1465498/update-libssl-so-1-1-for-the-latest-version>

Looking at the deps, the source of this linkage is the new HTTP
client bindings.

This commit dances around this issue by using the rustls implementation
for the client instead.

It's possible that this won't be sufficient, but it at least removes
the openssl linkage issue as a source of headaches for now.
2023-05-15 08:59:49 -07:00
Wez Furlong 9bc92b9a73 rustfmt 2023-05-08 15:21:00 -07:00
Wez Furlong 0211b03060 http: add helpers for constructing form data
refs: https://github.com/KumoCorp/kumomta/issues/36
2023-05-08 15:06:09 -07:00
Wez Furlong 001ba6d46f http: allow inspecting status even after the body has been read 2023-05-08 09:09:04 -07:00
Wez Furlong 5dfa6e5865 add http client module
```lua
  local response = kumo.http
    .build_client({})
    :get('https://example.com/')
    :send()
  print(response:status_code(), response:status_reason())
  for k, v in pairs(response:headers()) do
    print("Header", k, v)
  end
  print(response:text())
```
2023-05-05 14:26:09 -07:00