struct_http_message.md 1.08 KB
Newer Older
1 2 3 4 5 6 7
---
title: "struct http_message"
decl_name: "struct http_message"
symbol_kind: "struct"
signature: |
  struct http_message {
    struct mg_str message; /* Whole message: request line + headers + body */
8
    struct mg_str body;    /* Message body. 0-length for requests with no body */
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
  
    /* HTTP Request line (or HTTP response line) */
    struct mg_str method; /* "GET" */
    struct mg_str uri;    /* "/my_file.html" */
    struct mg_str proto;  /* "HTTP/1.1" -- for both request and response */
  
    /* For responses, code and response status message are set */
    int resp_code;
    struct mg_str resp_status_msg;
  
    /*
     * Query-string part of the URI. For example, for HTTP request
     *    GET /foo/bar?param1=val1&param2=val2
     *    |    uri    |     query_string     |
     *
     * Note that question mark character doesn't belong neither to the uri,
     * nor to the query_string
     */
    struct mg_str query_string;
  
    /* Headers */
    struct mg_str header_names[MG_MAX_HTTP_HEADERS];
    struct mg_str header_values[MG_MAX_HTTP_HEADERS];
  };
---

HTTP message