2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
title: "mg_send_response_line()"
|
|
|
|
decl_name: "mg_send_response_line"
|
|
|
|
symbol_kind: "func"
|
|
|
|
signature: |
|
2016-09-30 19:16:08 +08:00
|
|
|
void mg_send_response_line(struct mg_connection *nc, int status_code,
|
2016-05-12 04:36:12 +08:00
|
|
|
const char *extra_headers);
|
|
|
|
---
|
|
|
|
|
2016-09-01 22:19:01 +08:00
|
|
|
Sends the response status line.
|
2016-05-12 04:36:12 +08:00
|
|
|
If `extra_headers` is not NULL, then `extra_headers` are also sent
|
|
|
|
after the reponse line. `extra_headers` must NOT end end with new line.
|
|
|
|
Example:
|
|
|
|
|
|
|
|
mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
|
|
|
|
|
|
|
|
Will result in:
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK\r\n
|
|
|
|
Access-Control-Allow-Origin: *\r\n
|
|
|
|
|