Line break character in HTTP headers

I send the following response from the server:

QString response = "HTTP/1.1 \r\n Access-Control-Allow-Origin: * \r\n 200 OK \r\n\r\n";

I don't fully understand where exactly in the response to "shove" the Access-Control-Allow-Origin parameter and whether I correctly specified the line break characters

1 answers

First the status line, then the headers, then the empty line.

HTTP/1.1 200 OK<CRLF>
Access-Control-Allow-Origin: *<CRLF>
<CRLF>

Https://ru.wikipedia.org/wiki/HTTP

 3
Author: Abyx, 2019-09-17 16:37:25