getst.xml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <refentry id="refgetst">
  2. <refmeta>
  3. <refentrytitle>ne_get_status</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_get_status">ne_get_status</refname>
  8. <refpurpose>retrieve HTTP response status for request</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcsynopsisinfo>#include &lt;ne_request.h&gt;</funcsynopsisinfo>
  13. <funcprototype>
  14. <funcdef>const ne_status *<function>ne_get_status</function></funcdef>
  15. <paramdef>const ne_request *<parameter>request</parameter></paramdef>
  16. </funcprototype>
  17. </funcsynopsis>
  18. </refsynopsisdiv>
  19. <refsect1>
  20. <title>Description</title>
  21. <para>The <function>ne_get_status</function> function returns
  22. a pointer to the HTTP status object giving the result of a request.
  23. The object returned only becomes valid once the request has been
  24. <emphasis>successfully</emphasis> dispatched (the return value of
  25. <function>ne_request_dispatch</function> or
  26. <function>ne_begin_request</function> was zero). The object remains
  27. valid until the associated request object is destroyed.</para>
  28. </refsect1>
  29. <refsect1>
  30. <title>See also</title>
  31. <para><xref linkend="ne_status"/>, <xref
  32. linkend="ne_request_create"/></para>
  33. </refsect1>
  34. <refsect1>
  35. <title>Example</title>
  36. <para>Display the response status code of applying the
  37. <literal>HEAD</literal> method to some resource.</para>
  38. <programlisting>ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
  39. if (ne_request_dispatch(req))
  40. /* handle errors... */
  41. else
  42. printf("Response status code was %d\n", ne_get_status(req)->code);
  43. ne_request_destroy(req);</programlisting>
  44. </refsect1>
  45. </refentry>