fix: use the proper content-type header for ezcurl

This commit is contained in:
Simon Cruanes 2023-06-20 11:08:38 -04:00
parent 6e198207dc
commit 5c45589882
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -118,9 +118,11 @@ end = struct
if !debug_ || config.debug then
Printf.eprintf "opentelemetry: send http POST to %s (%dB)\n%!" url
(String.length data);
let headers =
("Content-Type", "application/x-protobuf") :: config.headers
in
match
Ezcurl.post ~headers:config.headers ~client ~params:[] ~url
~content:(`String data) ()
Ezcurl.post ~headers ~client ~params:[] ~url ~content:(`String data) ()
with
| Ok { code; _ } when code >= 200 && code < 300 -> ()
| Ok { code; body; headers = _; info = _ } ->