companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
spip has joined #ocaml
bobo_ has quit [Ping timeout: 255 seconds]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 255 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
qxz2 has quit [Changing host]
qxz2 has joined #ocaml
waleee has joined #ocaml
trillion_exabyte has quit [Ping timeout: 252 seconds]
trillion_exabyte has joined #ocaml
trillion_exabyte has quit [Ping timeout: 260 seconds]
trillion_exabyte has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
trillion_exabyte has quit [Ping timeout: 255 seconds]
trillion_exabyte has joined #ocaml
rf has quit [Quit: Leaving]
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
trillion_exabyte has quit [Ping timeout: 246 seconds]
trillion_exabyte has joined #ocaml
mbuf has joined #ocaml
trev has joined #ocaml
Haudegen has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
bartholin has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
mro has joined #ocaml
Serpent7776 has joined #ocaml
trillion_exabyte has quit [Ping timeout: 255 seconds]
trillion_exabyte has joined #ocaml
<discocaml_> <Et7f3 (@me on reply)> is incredible ? Is too cool ?
bartholin has quit [Quit: Leaving]
olle has joined #ocaml
kakadu has joined #ocaml
mbuf has quit [Ping timeout: 246 seconds]
maiste has joined #ocaml
maiste has quit [Quit: WeeChat 3.8]
azimut has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
wingsorc has quit [Ping timeout: 252 seconds]
bobo_ has quit [Quit: Konversation terminated!]
<discocaml_> <cemerick> @companion_cube do you know of a good example for Ezcurl.post somewhere? I flailed around with it for too long last night; I was able to get it to send a multipart post, but couldn't figure out the incantation for a regular urlencoded form post.
<discocaml_> <undu> There's an example in this PR? https://github.com/c-cube/ezcurl/pull/10
<discocaml_> <undu> There's an example in this PR, maybe it can help you? https://github.com/c-cube/ezcurl/pull/10
Haudegen has quit [Quit: Bin weg.]
<discocaml_> <smondet> we do some Ezcurl POSTs there: https://gitlab.com/oxheadalpha/merbocop/blob/master/src/lib/web_api.ml#L60-160
<discocaml_> <cemerick> Yeah, that usage produces multipart posts, right?
<discocaml_> <val patate: unit Lazy.t> "is not enough like [ insert other language here ]
<discocaml_> <val patate: unit Lazy.t> "is not enough like [ insert other language here ]"
<discocaml_> <Et7f3 (@me on reply)> No this isn't true
<discocaml_> <Et7f3 (@me on reply)> (Ok maybe rust super error message)
<discocaml_> <cemerick> I actually tried that (pinning to the HEAD as well), and it could work (it's not a typical form post, but I could work with it since I control both ends of the HTTP call), but AFAICT any request that carries a body (via `~content`) hangs for almost a full second before being sent
<discocaml_> <cemerick> (that's a separate problem I was going to file an issue on)
<discocaml_> <cemerick> the same data plastered into the URL as part of the query string flows right through tho
<discocaml_> <smondet> yes I think, sorry I don't really remember I didn't write that code 🙂
<discocaml_> <cemerick> no worries, thanks for looking out 🙂
<discocaml_> <Anurag> @cemerick Depending on the size of the body if it’s larger than some threshold curl sends a request indicating it’s waiting for a 100 continue header and waits for the server to acknowledge it before sending the body. There’s a timeout for this and if the server doesn’t acknowledge curl continues sending the body.
<discocaml_> <Anurag> You could either have your server acknowledge this request and respond with an expect continue (or reject if you think the payload is too large) or disable this option in via curl options.
<discocaml_> <Anurag> You could either have your server acknowledge this request and respond with an expect continue (or reject if you think the payload is too large) or disable this option on the client side via curl options.
<discocaml_> <Anurag> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100> has some more details. I’d expect the request headers to confirm if this is indeed what’s happening. My guess is yes since I’ve also noticed a second long pause with curl in the past.
<discocaml_> <cemerick> really! I've never heard of this. The payload in this case is in the hundreds of bytes tho, and the equivalent `curl` command line results in instant turnaround
<companion_cube> @smondet would you be willing to add an example to the docs of ezcurl?
<discocaml_> <cemerick> will check the headers tho
<companion_cube> I'm not a curl expert and I use it more for get than other things
<companion_cube> (and contributions welcome! 😁)
<discocaml_> <Anurag> @cemerick hmm. 100s of bytes doesn’t sound too large so not sure about the delay in that case. I noticed it when the body was a few Megabytes. The 100-continue thing was news to me at that time as well!
<discocaml_> <cemerick> Yes, `curl` command line sends no `Expect` header, ezcurl by default does, for any request that carries a body
<discocaml_> <cemerick> I shall dig around for the requisite config flag
<discocaml_> <Anurag> Cool. That makes sense! That header explains the delay you see. None of the OCaml http server libraries handle this scenario from what I remember, so your best bet will be to update the client settings.
masterbuilder has joined #ocaml
<discocaml_> <cemerick> hah! https://github.com/aantron/dream/issues/61 🙃
<discocaml_> <cemerick> Okay, the canonical workaround for the expect thing is to set an empty Expect header, i.e. `~headers:["Expect", ""]` with Ezcurl; there is a configuration setting for libcurl (`EXPECT_100_THRESHOLD`), but it doesn't seem to be exposed by ocurl
masterbuilder has quit [Quit: leaving]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has joined #ocaml
<discocaml_> <cemerick> well, that was a bit of a saga 😅 https://github.com/c-cube/ezcurl/issues/12 Thanks for the pointer @Anurag
Serpent7776 has quit [Ping timeout: 260 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
rf has joined #ocaml
mro has quit [Remote host closed the connection]
tjnhxmzhmqgytuwt has quit [Ping timeout: 248 seconds]
AnuragSoni[m] has quit [Ping timeout: 248 seconds]
h11 has quit [Ping timeout: 256 seconds]
technomancy[m] has quit [Ping timeout: 260 seconds]
georgyo[m] has quit [Ping timeout: 246 seconds]
reynir[m] has quit [Ping timeout: 264 seconds]
AnuragSoni[m] has joined #ocaml
Serpent7776 has joined #ocaml
georgyo[m] has joined #ocaml
reynir[m] has joined #ocaml
Serpent7776 has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
Serpent7776 has joined #ocaml
h11 has joined #ocaml
technomancy[m] has joined #ocaml
tjnhxmzhmqgytuwt has joined #ocaml
<companion_cube> @cemerick: just double checking, but you do use `String for the content part, correct?
<discocaml_> <cemerick> Yeah, never did anything with `Writer
<discocaml_> <cemerick> or maybe it's `Write
<companion_cube> I do observe the header 100 even when passing a string, indeed
bgs has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
mro has joined #ocaml
azimut has joined #ocaml
mro has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 264 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
waleee has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<companion_cube> alright, might have found it!!
<companion_cube> (using the verbose option to see what curl does is priceless)
waleee has quit [Ping timeout: 248 seconds]
rhart has quit [Remote host closed the connection]
sadiq_ has joined #ocaml
mro has joined #ocaml
rak_ has joined #ocaml
rf has quit [*.net *.split]
trev has quit [*.net *.split]
qxz2 has quit [*.net *.split]
asm has quit [*.net *.split]
rom1504 has quit [*.net *.split]
noze` has quit [*.net *.split]
tizoc has quit [*.net *.split]
brettgilio has quit [*.net *.split]
dme2_ has quit [*.net *.split]
ocabot_ has quit [*.net *.split]
technomancy has quit [*.net *.split]
Ekho has quit [*.net *.split]
towel_ has quit [*.net *.split]
kronicma1 has quit [*.net *.split]
sadiq has quit [*.net *.split]
rak has quit [*.net *.split]
companion_cube has quit [*.net *.split]
drewolson has quit [*.net *.split]
mro has quit [Remote host closed the connection]
trev has joined #ocaml
tizoc has joined #ocaml
dme2_ has joined #ocaml
brettgilio has joined #ocaml
technomancy has joined #ocaml
qxz2 has joined #ocaml
asm has joined #ocaml
rom1504 has joined #ocaml
towel_ has joined #ocaml
noze` has joined #ocaml
Ekho has joined #ocaml
rf has joined #ocaml
ocabot_ has joined #ocaml
companion_cube has joined #ocaml
drewolson has joined #ocaml
kronicma1 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Serpent7776 has quit [Quit: WeeChat 1.9.1]
waleee has joined #ocaml
John_Ivan has quit [Read error: Connection reset by peer]
spip has joined #ocaml
dhil has joined #ocaml
John_Ivan has joined #ocaml
trillion_exabyte has quit [Ping timeout: 255 seconds]
mro has joined #ocaml
trillion_exabyte has joined #ocaml
mro has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 248 seconds]
Serpent7776 has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Tuplanolla has joined #ocaml
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
gwizon has joined #ocaml
wingsorc has joined #ocaml
Stumpfenstiel has joined #ocaml
olle has quit [Ping timeout: 246 seconds]
Haudegen has quit [Ping timeout: 248 seconds]
Stumpfenstiel has quit [Ping timeout: 264 seconds]
Stumpfenstiel has joined #ocaml
Haudegen has joined #ocaml
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
rf has quit [Read error: Connection reset by peer]
trev has quit [Remote host closed the connection]
rf has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
mro has quit [Quit: Leaving...]
bartholin has quit [Quit: Leaving]
Stumpfenstiel has quit [Ping timeout: 264 seconds]
olle has joined #ocaml
spip has quit [Quit: Konversation terminated!]
Haudegen has quit [Ping timeout: 264 seconds]