status.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <refentry id="refstatus">
  2. <refmeta>
  3. <refentrytitle>ne_status</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_status">ne_status</refname>
  8. <refpurpose>HTTP status structure</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis><funcsynopsisinfo>#include &lt;ne_utils.h&gt;
  12. typedef struct {
  13. int major_version;
  14. int minor_version;
  15. int code;
  16. int klass;
  17. char *reason_phrase;
  18. } <type>ne_status</type>;</funcsynopsisinfo></funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Description</title>
  22. <para>The <type>ne_status</type> type represents an HTTP
  23. response status; used in response messages giving a result of
  24. request. The <structfield>major_version</structfield> and
  25. <structfield>minor_version</structfield> fields give the
  26. protocol version supported by the server issuing the response.
  27. The <structfield>code</structfield> field gives the status
  28. code of the result (lying between <literal>100</literal> and
  29. <literal>599</literal> inclusive), and the
  30. <structfield>klass</structfield> field gives the class, which
  31. is equal to the most significant digit of the status. The
  32. <structfield>reason_phrase</structfield> field gives a
  33. human-readable string describing the status, which is purely
  34. informational (and optional) - any interpretation of the
  35. response status must be done using the
  36. <structfield>klass</structfield> and/or
  37. <structfield>code</structfield> fields.</para>
  38. <para>There are five classes of response status code defined
  39. for HTTP/1.1 (see <ulink
  40. url="https://www.rfc-editor.org/rfc/rfc9110#name-status-codes">RFC
  41. 9110 ẞ15</ulink>):</para>
  42. <variablelist>
  43. <varlistentry>
  44. <term><literal>1xx</literal></term>
  45. <listitem><simpara>Informational response.</simpara></listitem>
  46. </varlistentry>
  47. <varlistentry>
  48. <term><literal>2xx</literal></term>
  49. <listitem><simpara>Success: the operation was successful</simpara></listitem>
  50. </varlistentry>
  51. <varlistentry>
  52. <term><literal>3xx</literal></term>
  53. <listitem><simpara>Redirection</simpara></listitem>
  54. </varlistentry>
  55. <varlistentry>
  56. <term><literal>4xx</literal></term> <listitem><simpara>Client
  57. error: the request made was incorrect in some
  58. manner.</simpara></listitem>
  59. </varlistentry>
  60. <varlistentry>
  61. <term><literal>5xx</literal></term>
  62. <listitem><simpara>Server error</simpara></listitem>
  63. </varlistentry>
  64. </variablelist>
  65. </refsect1>
  66. <refsect1> <title>Notes</title> <para>The
  67. <structfield>klass</structfield> field is named
  68. <quote>klass</quote> not <quote>class</quote> so that the header
  69. can be used from a C++ program, in which <quote>class</quote> is
  70. a reserved word.</para></refsect1>
  71. <refsect1> <title>See also</title> <para><xref
  72. linkend="ne_get_status"/>.</para> </refsect1>
  73. </refentry>