I am trying to send a HTTP POST request and I am setting a value for the header field referer:
request.setValue("testRefererValue", forHTTPHeaderField: "referer")
But when the request is being hit the key value "referer" is being changed to "Referer" with a capital R automatically like below,
{"Referer": "testRefererValue"}
instead of:
{"referer": "testRefererValue"}
Backend developers who are receiving this request have written their code to parse key "referer" with small R and thus the request is failing.
Why is this happening? Is there a way to not make this happen? Thanks for the answers in advance.