I’m trying to type headers in ReScript, but … well, they’re dynamic. I checked out a few Ajax Reason projects, and it appears something along the lines of headers: Js.Dict.t<string>
should work, or even headers: Js.Dict.t<(string, string)>
. However, the compiler says they don’t match, and just says the header type doesn’t match. And by “header type” I mean, it prints out the entire object… so I don’t really have a clue on where to start trying to make it match.
{
'access-control-allow-origin': '*',
'access-control-allow-methods': 'POST, GET, OPTIONS, DELETE',
'access-control-request-headers': 'content-type,x-idempotency-key',
'access-control-allow-headers': 'content-type,x-idempotency-key'
}
Any pointers? This is for both request and response type things.