Set headers inside createServerAction$()
Hey folks,
I am currently trying to explicitely set my content type header to
Content-Type: application/json; charset=utf-8
because of some encoding issues.
However I don't quite understand how I can do so inside a call of createServerAction$()
.
I tried to access responseHeaders from useRequest()
, however they seem to be always undefined:
Any idea, what I am doing wrong here?
Thanks in advance1 Reply
I believe
responseHeaders
is read-only here, not sure but using Response
should work
also, if the intended goal is to send json, it's suggested to use the json
function from solid-start, using it will simplify the code above to: