I am trying to work on this issue:
https://github.com/gleam-lang/httpc/issues/34#issuecomment-3548386644
However, I'm not entirely sure how the Gleam options are passed to the Erlang httpc library through the FFI. I have added:
type ErlOption {
BodyFormat(BodyFormat)
SocketOpts(List(SocketOpt))
Ipv6HostWithBrackets(Bool)
}
To src/gleam/httpc.gleam, and then:
let erl_options = [
BodyFormat(Binary),
SocketOpts([Ipfamily(Inet6fb4)]),
Ipv6HostWithBrackets(True),
]
in pub fn dispatch_bits()
I've verified that my test is calling the correct code in my forked version of the library, but I'm still getting the runtime error.
Any clues? As far as I can tell, the PascalCase in gleam should be translated to ipv6_host_with_brackets in erlang automatically, but since this is unfamiliar territory I'm not entirely sure if the problem is that it isn't getting passed through, or if there is an issue in the underlying erlang library.