ocaml-cohttp icon indicating copy to clipboard operation
ocaml-cohttp copied to clipboard

Cohttp-lwt: Send 100-continue on POST with Expect: 100-continue

Open edwintorok opened this issue 2 years ago • 2 comments

See RFC7231 section 5.1.1 on Expect 'Requirements for servers'.

I've tested this with Ezcurl-0.2.2 and a POST request which sends a 100-continue header. Without this Curl will pause for 1s waiting for the server to send 100-continue. I also tested that inserting an artifical 10s sleep doesn't confuse curl (it gives up after 1s and sends the body anyway).

See Curl documentation on 100-continue and HTTP/1.1 RFC7231 5.1.1 Expect.

I've only implemented this for the Lwt backend for now.

edwintorok avatar Apr 04 '23 09:04 edwintorok

Thanks a lot!

mseri avatar Apr 04 '23 12:04 mseri

Would it be possible to add it also to async? And a test (if feasible). I think it should be easy to add in cohttp-lwt-unix test_sanity.ml.

mseri avatar Apr 04 '23 12:04 mseri