libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

libmicrohttpd-tutorial.texi (4971B)


      1 \input texinfo  @c -*-texinfo-*-
      2 @finalout
      3 @setfilename libmicrohttpd-tutorial.info
      4 @set UPDATED 28 July 2026
      5 @set UPDATED-MONTH July 2026
      6 @set EDITION 1.0.8
      7 @set VERSION 1.0.8
      8 @settitle A tutorial for GNU libmicrohttpd
      9 @c Unify all the indices into concept index.
     10 @syncodeindex fn cp
     11 @syncodeindex vr cp
     12 @syncodeindex ky cp
     13 @syncodeindex pg cp
     14 @syncodeindex tp cp
     15 
     16 @dircategory Software libraries
     17 @direntry
     18 * libmicrohttpdtutorial: (libmicrohttpd-tutorial).       A tutorial for GNU libmicrohttpd.
     19 @end direntry
     20 
     21 @copying
     22 This tutorial documents GNU libmicrohttpd version @value{VERSION}, last
     23 updated @value{UPDATED}.
     24 
     25 Copyright (c)  2008  Sebastian Gerhardt.
     26 
     27 Copyright (c)  2010, 2011, 2012, 2013, 2016, 2021, 2026  Christian Grothoff.
     28 @quotation
     29 Permission is granted to copy, distribute and/or modify this document
     30 under the terms of the GNU Free Documentation License, Version 1.3
     31 or any later version published by the Free Software Foundation;
     32 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
     33 Texts.  A copy of the license is included in the section entitled "GNU
     34 Free Documentation License".
     35 @end quotation
     36 @end copying
     37 
     38 @titlepage
     39 @title A Tutorial for GNU libmicrohttpd
     40 @subtitle Version @value{VERSION}
     41 @subtitle @value{UPDATED}
     42 @author Sebastian Gerhardt (@email{sebgerhardt@@gmx.net})
     43 @author Christian Grothoff (@email{christian@@grothoff.org})
     44 @author Matthieu Speder (@email{mspeder@@users.sourceforge.net})
     45 
     46 @page
     47 @vskip 0pt plus 1filll
     48 @insertcopying
     49 @end titlepage
     50 
     51 
     52 
     53 @contents
     54 
     55 @ifnottex
     56 @node Top
     57 @top A Tutorial for GNU libmicrohttpd
     58 @insertcopying
     59 @end ifnottex
     60 
     61 @menu
     62 * Introduction::
     63 * Hello browser example::
     64 * Exploring requests::
     65 * Response headers::
     66 * Supporting basic authentication::
     67 * Processing POST data::
     68 * Improved processing of POST data::
     69 * Session management::
     70 * Generating responses on the fly::
     71 * Answering from another thread::
     72 * Adding a layer of security::
     73 * Upgrading connections::
     74 * Bibliography::
     75 * License text::
     76 * Example programs::
     77 @end menu
     78 
     79 @node Introduction
     80 @chapter Introduction
     81 @include chapters/introduction.inc
     82 
     83 @node Hello browser example
     84 @chapter Hello browser example
     85 @include chapters/hellobrowser.inc
     86 
     87 @node Exploring requests
     88 @chapter Exploring requests
     89 @include chapters/exploringrequests.inc
     90 
     91 @node Response headers
     92 @chapter Response headers
     93 @include chapters/responseheaders.inc
     94 
     95 @node Supporting basic authentication
     96 @chapter Supporting basic authentication
     97 @include chapters/basicauthentication.inc
     98 
     99 @node Processing POST data
    100 @chapter Processing POST data
    101 @include chapters/processingpost.inc
    102 
    103 @node Improved processing of POST data
    104 @chapter Improved processing of POST data
    105 @include chapters/largerpost.inc
    106 
    107 @node Session management
    108 @chapter Session management
    109 @include chapters/sessions.inc
    110 
    111 @node Generating responses on the fly
    112 @chapter Generating responses on the fly
    113 @include chapters/callbackresponse.inc
    114 
    115 @node Answering from another thread
    116 @chapter Answering from another thread
    117 @include chapters/asyncresponses.inc
    118 
    119 @node Adding a layer of security
    120 @chapter Adding a layer of security
    121 @include chapters/tlsauthentication.inc
    122 
    123 @node Upgrading connections
    124 @chapter Upgrading connections
    125 @include chapters/upgrade.inc
    126 
    127 @node Bibliography
    128 @appendix Bibliography
    129 @include chapters/bibliography.inc
    130 
    131 @node License text
    132 @appendix GNU Free Documentation License
    133 @include fdl-1.3.texi
    134 
    135 @node Example programs
    136 @appendix Example programs
    137 @menu
    138 * hellobrowser.c::
    139 * logging.c::
    140 * responseheaders.c::
    141 * basicauthentication.c::
    142 * simplepost.c::
    143 * largepost.c::
    144 * sessions.c::
    145 * callbackresponse.c::
    146 * asyncresponse.c::
    147 * tlsauthentication.c::
    148 * upgrade.c::
    149 @end menu
    150 
    151 @node hellobrowser.c
    152 @section hellobrowser.c
    153 @smalldisplay
    154 @verbatiminclude examples/hellobrowser.c
    155 @end smalldisplay
    156 
    157 @node logging.c
    158 @section logging.c
    159 @smalldisplay
    160 @verbatiminclude examples/logging.c
    161 @end smalldisplay
    162 
    163 @node responseheaders.c
    164 @section responseheaders.c
    165 @smalldisplay
    166 @verbatiminclude examples/responseheaders.c
    167 @end smalldisplay
    168 
    169 @node basicauthentication.c
    170 @section basicauthentication.c
    171 @smalldisplay
    172 @verbatiminclude examples/basicauthentication.c
    173 @end smalldisplay
    174 
    175 @node simplepost.c
    176 @section simplepost.c
    177 @smalldisplay
    178 @verbatiminclude examples/simplepost.c
    179 @end smalldisplay
    180 
    181 @node largepost.c
    182 @section largepost.c
    183 @smalldisplay
    184 @verbatiminclude examples/largepost.c
    185 @end smalldisplay
    186 
    187 @node sessions.c
    188 @section sessions.c
    189 @smalldisplay
    190 @verbatiminclude examples/sessions.c
    191 @end smalldisplay
    192 
    193 @node callbackresponse.c
    194 @section callbackresponse.c
    195 @smalldisplay
    196 @verbatiminclude examples/callbackresponse.c
    197 @end smalldisplay
    198 
    199 @node asyncresponse.c
    200 @section asyncresponse.c
    201 @smalldisplay
    202 @verbatiminclude examples/asyncresponse.c
    203 @end smalldisplay
    204 
    205 @node tlsauthentication.c
    206 @section tlsauthentication.c
    207 @smalldisplay
    208 @verbatiminclude examples/tlsauthentication.c
    209 @end smalldisplay
    210 
    211 @node upgrade.c
    212 @section upgrade.c
    213 @smalldisplay
    214 @verbatiminclude examples/upgrade.c
    215 @end smalldisplay
    216 
    217 @bye