libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

requests.inc (23387B)


      1 A @code{struct MHD_Request} is given by MHD to the application
      2 to refer to an individual HTTP request by a client.  Applications
      3 primarily are given a request handle as part of the arguments given
      4 to the central @ref{MHD_RequestCallback,,@code{MHD_RequestCallback}}
      5 of each @code{struct MHD_Daemon}.
      6 
      7 @deftp {C Struct} MHD_Request
      8 Handle representing an HTTP request.
      9 
     10 With HTTP/1.1, multiple requests can be run over the same
     11 stream.  However, MHD will only show one request per data
     12 stream to the application at any given time.
     13 @end deftp
     14 
     15 This chapter discusses how to inspect the information
     16 from the request @emph{header}.
     17 @xref{libmicrohttpd-actions-upload} for handling data uploaded
     18 by HTTP clients in the body of a request.
     19 
     20 
     21 @node libmicrohttpd-requests-name-value-info
     22 @section Inspecting request name-value pairs
     23 
     24 When inspecting requests, MHD classifies values from a client's
     25 request into various @emph{kinds} of values. The different kinds
     26 are represented by the @code{enum MHD_ValueKind}.
     27 
     28 @anchor{MHD_ValueKind}
     29 @deftp {Enumeration} MHD_ValueKind
     30 @cindex header
     31 @cindex kind
     32 
     33 Specifies the source of the name-value pairs in the HTTP protocol.
     34 
     35 @table @code
     36 @item MHD_VK_HEADER
     37 HTTP header (single line in the header).
     38 
     39 @item MHD_VK_COOKIE
     40 Cookies.  Note that the original HTTP header containing
     41 all the cookie(s) is also available via @code{MHD_VK_HEADER}.
     42 
     43 @item MHD_VK_URL_ARGUMENT
     44 URL arguments (often called "GET" parameters, but not actually limited to the HTTP GET method).
     45 
     46 @item MHD_VK_POSTDATA
     47 POST data.
     48 This is available only if @ref{MHD_action_parse_post,,@code{MHD_action_parse_post()}} is used,
     49 the body's content encoding is supported by MHD, and only if the posted content
     50 fits within the specified memory buffers.
     51 
     52 @cindex Transfer-Encoding
     53 Warning: The encoding ``multipart/form-data'' has more fields than just
     54 ``name'' and ``value'' which are not available via the APIs discussed
     55 in this chapter. @xref{MHD_request_get_post_data_cb} and
     56 @ref{MHD_request_get_post_data_list,,@code{MHD_request_get_post_data_list()}} for more information.
     57 In particular it could be important
     58 to check the ``Transfer-Encoding''.
     59 
     60 @item MHD_VK_FOOTER
     61 Data from client request HTTP footer (only for HTTP 1.1 chunked encodings).
     62 
     63 @item MHD_VK_HEADER_OR_FOOTER
     64 Values from both the HTTP header or footer.
     65 
     66 @item MHD_VK_URL_OR_POST
     67 Values from URL arguments or post data.
     68 
     69 @end table
     70 @end deftp
     71 
     72 Given a value @var{kind} (or possibly a bitmask combining different
     73 kinds), MHD offers various ways to access values from of that kind
     74 for a given @var{request}.
     75 
     76 @c FIXME: why int? what would negative values be used for?
     77 @anchor{MHD_request_get_values_cb}
     78 @deftypefun int MHD_request_get_values_cb (struct MHD_Request *request, enum MHD_ValueKind kind, MHD_NameValueIterator iterator, void *iterator_cls)
     79 Get all the headers matching @var{kind} from the request.
     80 
     81 @table @var
     82 @item request
     83 the HTTP request to inspect;
     84 
     85 @item kind
     86 kinds of name-value pairs of the request to pass to @var{iterator},
     87 can be a bitmask, ORing the various header kinds that are requested
     88 (@xref{MHD_ValueKind});
     89 
     90 @item iterator
     91 This callback function is invoked once for each header, with
     92 @var{iterator_cls} as first argument.  The
     93 headers are iterated in the same order as they were received from
     94 the network.
     95 @var{iterator} can be @code{NULL}: in this case this function just counts
     96 and returns the number of headers;
     97 
     98 @item iterator_cls
     99 closure argument for @var{iterator}.
    100 @end table
    101 
    102 The function returns the number of entries
    103 iterated over; this can be less than the number of headers if, while
    104 iterating, @var{iterator} returns @code{MHD_NO}.
    105 @end deftypefun
    106 
    107 @var{iterator}s implementing the @code{MHD_NameValueIterator}
    108 are simply given the specific @var{kind} and name-and-value pair.
    109 
    110 @c FIXME: why don't we use NameValueKind here?
    111 @anchor{MHD_NameValueIterator}
    112 @deftypefn {Function Pointer} {enum MHD_Bool} (*MHD_NameValueIterator) (void *cls, enum MHD_ValueKind kind, const struct MHD_NameAndValue *nv)
    113 
    114 Functions of this type are invoked by MHD for each matching
    115 name-value pair.
    116 
    117 @table @var
    118 @item cls
    119 custom closure provided by the application to @code{MHD_request_get_values_cb()};
    120 
    121 @item kind
    122 the type (kind) of the element; will only have one bit set
    123 (@xref{MHD_ValueKind});
    124 
    125 @item nv
    126 the name and the value of the element,
    127 the referenced data is valid only until the
    128 application returns from this function.
    129 @end table
    130 The function should return @code{MHD_YES} to continue to
    131 iterate, and @code{MHD_NO} to abort the iteration.
    132 @end deftypefn
    133 
    134 
    135 @anchor{MHD_NameAndValue}
    136 @deftp {C Struct} MHD_NameAndValue name value
    137 Represents a pair of a name and a value.
    138 @table @code
    139 @item @code{struct MHD_String} name
    140 Name under which the value is stored, some kinds allow empty strings;
    141 
    142 @item @code{struct MHD_StringNullable} value
    143 The value of the field.  Some kinds allow absence of the value;
    144 the absence is indicated by a @code{NULL} pointer to the C string.
    145 @c FIXME: We need to be clearer if value is NULL or cstr is NULL!
    146 @end table
    147 @end deftp
    148 
    149 @c FIXME: rename GET -> URL?
    150 If @var{kind} is @code{MHD_VK_GET_ARGUMENT}, the @var{value} argument
    151 given to the @var{iterator} callback will be @code{NULL} if the URL
    152 contained a key without an equals operator.
    153 For example, for a HTTP request to the URL ``http://foo/bar?key'', the
    154 @var{value} argument is @code{NULL}; in contrast, a HTTP request to the URL
    155 ``http://foo/bar?key='', the @var{value} argument is the empty string.
    156 The normal case is that the URL contains ``http://foo/bar?key=value''
    157 in which case @var{value} would be the string ``value'' and @var{key}
    158 would contain the string ``key''.
    159 
    160 
    161 @c FIXME: why int? what would negative values be used for?
    162 @anchor{MHD_request_get_values_list}
    163 @deftypefun int MHD_request_get_values_list (struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, struct MHD_NameValueKind elements[num_elements])
    164 Get all the headers matching @var{kind} from the request.
    165 
    166 The pointers to the strings returned in @var{elements} are valid until
    167 any @code{struct MHD_Action} or @code{struct MHD_UploadAction} is
    168 provided for the @var{request}. If the data is needed beyond this
    169 point, it should be copied to an application buffer before returning
    170 an action.
    171 
    172 @table @var
    173 @item request
    174 the HTTP request to inspect;
    175 
    176 @item kind
    177 kinds of name-value pairs of the request to pass to @var{iterator},
    178 can be a bitmask, ORing the various header kinds that are requested;
    179 
    180 @item num_elements
    181 length of the @var{elements} array provided
    182 
    183 @item elements
    184 array of length @var{num_elements} to be filled with
    185 the key-value pairs; if @var{request} has more matching elements
    186 than @var{num_elements} than any @var{num_elements} are stored.
    187 @end table
    188 
    189 The function returns the number of entries
    190 stored in @var{elements}, the number cannot be larger
    191 than @var{num_elements}, zero if there were no matching
    192 elements or on any error.
    193 @end deftypefun
    194 
    195 @anchor{MHD_NameValueKind}
    196 @deftp {C Struct} MHD_NameValueKind nv kind
    197 Represents a triplet of a name, value and kind.
    198 @table @code
    199 @item @code{struct MHD_NameAndValue} nv
    200 The name and value of the field
    201 (@xref{MHD_NameAndValue});
    202 
    203 @item @code{struct MHD_ValueKind} kind
    204 The kind of the field
    205 (@xref{MHD_ValueKind}).
    206 @end table
    207 @end deftp
    208 
    209 @anchor{MHD_request_get_value}
    210 @deftypefun {const struct MHD_StringNullable *} MHD_request_get_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
    211 
    212 Returns a particular data value from a @var{request}.
    213 
    214 @table @var
    215 @item request
    216 the HTTP request to inspect;
    217 
    218 @item kind
    219 kinds of name-value pairs of the request to pass to @var{iterator},
    220 can be a bitmask, ORing the various header kinds that are requested
    221 (@xref{MHD_ValueKind});
    222 
    223 @item key
    224 the name of the value to look for (used for case-insensitive
    225 match), use an empty string to lookup 'trailing' values without a key;
    226 @var{key} must reference a zero-terminated ASCII-coded string
    227 representing the value to look for.
    228 @end table
    229 The function returns @code{NULL} if no matching item was found.
    230 If multiple values match the
    231 @var{kind} and @var{key}, returns the first of them.
    232 @end deftypefun
    233 
    234 
    235 The following code is a simple example to determine the
    236 value of a ``Host:'' header.
    237 
    238 @example
    239 @verbatiminclude examples/host-example.c
    240 @end example
    241 
    242 
    243 
    244 @node libmicrohttpd-request-status-info
    245 @section Obtaining request status information
    246 
    247 This section describes the request introspection API.  It follows the
    248 same patterns as the other introspection APIs described in
    249 @ref{libmicrohttpd2-introspection,,Introspecting MHD objects}.  You
    250 may want to refer to the introduction of that chapter for an overview
    251 on MHD introspection.
    252 
    253 @anchor{MHD_request_get_info_fixed_sz}
    254 @deftypefun {enum MHD_StatusCode} MHD_request_get_info_fixed_sz (struct MHD_Request *request, enum MHD_RequestInfoFixedType info_type, union MHD_RequestInfoFixedData *output_buf, size_t output_buf_size)
    255 
    256 Obtain fixed information about the given request.
    257 This information is not changed for the lifetime of the request.
    258 
    259 @table @var
    260 @item request
    261 the request to get information about;
    262 
    263 @item info_type
    264 the type of information requested;
    265 
    266 @item output_buf
    267 output_buf the pointer to union to be set to the requested
    268 information;
    269 
    270 @item output_buf_size
    271 size of @var{output_buf} in bytes
    272 @end table
    273 
    274 The function returns:
    275 @table @code
    276 @item MHD_SC_OK
    277 on success,
    278 @c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data?
    279 
    280 @item MHD_SC_TOO_EARLY
    281 if the information is not yet available,
    282 usually because the respective stage in processing was not yet reached,
    283 
    284 @item MHD_SC_TOO_LATE
    285 if the information is no longer available,
    286 usually because processing is past the stage where the information is kept,
    287 
    288 @item MHD_SC_INFO_GET_TYPE_UNKNOWN
    289 if @var{info_type} is unknown,
    290 
    291 @item MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE
    292 if the requested information is not available for this specific
    293 object due to how that object was configured,
    294 
    295 @item MHD_SC_INFO_GET_TYPE_UNOBTAINABLE
    296 if the requested information should be available
    297 but cannot be provided due to some error or other reason,
    298 
    299 @item MHD_SC_INFO_GET_BUFF_TOO_SMALL
    300 if @var{output_buf} is too small for this request;
    301 @end table
    302 specific @var{info_type} values may yield additional
    303 type-specific error codes.
    304 @end deftypefun
    305 
    306 Using the above function directly is not recommended.
    307 Instead, applications should use @code{MHD_request_get_info_fixed()}
    308 which is more convenient as it uses a macro to automatically
    309 provide the @var{output_buf_size}.
    310 
    311 @anchor{MHD_request_get_info_fixed}
    312 @deftypefun {enum MHD_StatusCode} MHD_request_get_info_fixed (struct MHD_Request *request, enum MHD_RequestInfoFixedType info_type, union MHD_RequestInfoFixedData *output_buf)
    313 
    314 Obtain fixed information about the given request.
    315 This information is not changed for the lifetime of the request.
    316 
    317 @table @var
    318 @item request
    319 the request to get information about;
    320 
    321 @item info_type
    322 the type of information requested;
    323 
    324 @item output_buf
    325 output_buf the pointer to union to be set to the requested
    326 information;
    327 @end table
    328 
    329 The macro returns the same values as
    330 @code{MHD_request_get_info_fixed_sz()}
    331 @end deftypefun
    332 
    333 
    334 @deftp {Enumeration} MHD_RequestInfoFixedType
    335 Selects which fixed information about the request is desired.
    336 
    337 @table @code
    338 @anchor{MHD_REQUEST_INFO_FIXED_HTTP_VER}
    339 @item MHD_REQUEST_INFO_FIXED_HTTP_VER
    340 Get the version of HTTP protocol used for the request.
    341 If the request line has not been fully received yet then @code{MHD_SC_TOO_EARLY}
    342 is returned.
    343 The result is placed in the @var{v_http_ver} member of @var{output_buf}.
    344 
    345 @anchor{MHD_REQUEST_INFO_FIXED_HTTP_METHOD}
    346 @item MHD_REQUEST_INFO_FIXED_HTTP_METHOD
    347 Get the HTTP method used for the
    348 request (as an @ref{MHD_HTTP_Method}).
    349 The result is placed in @var{v_http_method} member.
    350 @xref{MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR}.
    351 
    352 @item MHD_REQUEST_INFO_FIXED_DAEMON
    353 Return the daemon to which the request belongs to.
    354 The result is placed in the @var{v_daemon} member of @var{output_buf}.
    355 
    356 @item MHD_REQUEST_INFO_FIXED_CONNECTION
    357 Return which connection is associated with the stream which is associated
    358 with the request. The result is placed in the @var{v_connection} member of @var{output_buf}.
    359 
    360 @item MHD_REQUEST_INFO_FIXED_STREAM
    361 Return which stream the request is associated with.
    362 The result is placed in the @var{v_stream} member of @var{output_buf}.
    363 
    364 @anchor{MHD_REQUEST_INFO_FIXED_APP_CONTEXT}
    365 @item MHD_REQUEST_INFO_FIXED_APP_CONTEXT
    366 Returns the pointer to a variable pointing to request-specific
    367 application context data. The same data is provided for
    368 @ref{MHD_EarlyUriLogCallback,,@code{MHD_EarlyUriLogCallback}}.
    369 @c FIXME and @ref{MHD_RequestCompletedCallback,,@code{MHD_RequestCompletedCallback}}.
    370 By using provided pointer application may get or set the pointer to
    371 any data specific for the particular request.
    372 The result is placed in the @var{v_ppvoid} member of @var{output_buf}.
    373 
    374 @end table
    375 @end deftp
    376 
    377 @c FIXME: define MHD_RequestTerminationCallback!
    378 
    379 @anchor{MHD_RequestInfoFixedData}
    380 @deftp {C Union} MHD_RequestInfoFixedData
    381 
    382 Fixed information about a request.
    383 This information will not change during the lifetime of the request.
    384 
    385 @table @var
    386 @item @code{struct MHD_Stream *} v_stream
    387 The stream of the request.
    388 
    389 @item @code{struct MHD_Connection *} v_connection
    390 The connection of the request.
    391 
    392 @item @code{struct MHD_Daemon *} v_daemon
    393 The daemon handling the request.
    394 
    395 @item @code{enum MHD_HTTP_ProtocolVersion} v_http_ver
    396 The HTTP protocol version used for the request.
    397 
    398 @item @code{enum MHD_HTTP_Method} v_http_method
    399 The HTTP method of the request.
    400 
    401 @item @code{void **} v_ppvoid
    402 The pointer to a pointer where the application can store
    403 contextual data for the request.
    404 @end table
    405 @end deftp
    406 
    407 
    408 @anchor{MHD_request_get_info_dynamic_sz}
    409 @deftypefun {enum MHD_StatusCode} MHD_request_get_info_dynamic_sz (struct MHD_Request *request, enum MHD_RequestInfoDynamicType info_type, union MHD_RequestInfoDynamicData *output_buf, size_t output_buf_size)
    410 
    411 Obtain dynamic information about the given request.
    412 This information may be changed during the lifetime of the request.
    413 Most of the data provided is available only after the request line or even the complete
    414 request headers have been processed. Data may also be no longer available once MHD
    415 has started to return the response.
    416 
    417 Any pointers in the returned data are only valid until any
    418 @code{struct MHD_Action} or @code{struct MHD_UploadAction} is
    419 returned to MHD. If the returned data is needed beyond this point,
    420 it should be copied into an application buffer before returning an
    421 action.
    422 
    423 @table @var
    424 @item request
    425 the request to get information about;
    426 
    427 @item info_type
    428 the type of information requested;
    429 
    430 @item output_buf
    431 output_buf the pointer to union to be set to the requested
    432 information;
    433 
    434 @item output_buf_size
    435 size of @var{output_buf} in bytes;
    436 @end table
    437 
    438 The function returns
    439 @table @code
    440 @item MHD_SC_OK
    441 on success,
    442 @c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data?
    443 
    444 @item MHD_SC_TOO_EARLY
    445 if the information is not yet available,
    446 usually because the respective stage in processing was not yet reached,
    447 
    448 @item MHD_SC_TOO_LATE
    449 if the information is no longer available,
    450 usually because processing is past the stage where the information is kept,
    451 
    452 @item MHD_SC_INFO_GET_TYPE_UNKNOWN
    453 if @var{info_type} is unknown,
    454 
    455 @item MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE
    456 if the requested information is not available for this specific
    457 object due to how that object was configured,
    458 
    459 @item MHD_SC_INFO_GET_TYPE_UNOBTAINABLE
    460 if the requested information should be available
    461 but cannot be provided due to some error or other reason,
    462 
    463 @item MHD_SC_INFO_GET_BUFF_TOO_SMALL
    464 if @var{output_buf} is too small for this request;
    465 @end table
    466 specific @var{info_type} values may yield additional
    467 type-specific error codes.
    468 @end deftypefun
    469 
    470 Using the above function directly is not recommended.
    471 Instead, applications should probably use
    472 @code{MHD_request_get_info_dynamic()}
    473 which is more convenient as it uses a macro to automatically
    474 provide the @var{output_buf_size}.
    475 
    476 @anchor{MHD_request_get_info_dynamic}
    477 @deftypefun {enum MHD_StatusCode} MHD_request_get_info_dynamic (struct MHD_Request *request, enum MHD_RequestInfoDynamicType info_type, union MHD_RequestInfoDynamicData *output_buf)
    478 
    479 Obtain fixed information about the given request.
    480 This information is not changed for the lifetime of the request.
    481 
    482 @table @var
    483 @item request
    484 the request to get information about;
    485 
    486 @item info_type
    487 the type of information requested;
    488 
    489 @item output_buf
    490 output_buf the pointer to union to be set to the requested
    491 information;
    492 @end table
    493 
    494 The macro returns the same values as
    495 @code{MHD_request_get_info_dynamic_sz()}
    496 @end deftypefun
    497 
    498 
    499 @anchor{MHD_RequestInfoDynamicType}
    500 @deftp {Enumeration} MHD_RequestInfoDynamicType
    501 
    502 Selects what dynamic information about request is desired.
    503 This information may be changed during the lifetime of the request.
    504 Any returned string pointers are valid only until a response is
    505 provided for the request by the application!
    506 
    507 @c FIXME: fix member names in C code, use semantic names, not type-names!
    508 @table @code
    509 
    510 @anchor{MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR}
    511 @item MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR
    512 Get the HTTP method used for the request (as a MHD_String).
    513 The result is placed in @var{v_str} member.
    514 The resulting string pointer is valid only until a response is provided.
    515 @xref{MHD_REQUEST_INFO_FIXED_HTTP_METHOD}
    516 
    517 @item MHD_REQUEST_INFO_DYNAMIC_URI
    518 Get the URI used for the request (as a MHD_String), excluding
    519 the parameter part (anything after '?').
    520 The result is placed in the @var{v_str} member.
    521 The resulting string pointer in valid only until a response is provided.
    522 
    523 @item MHD_REQUEST_INFO_DYNAMIC_NUMBER_GET_PARAMS
    524 Get the number of GET parameters (the decoded part of the original
    525 URI string after '?')
    526 The result is placed in the @var{v_sizet} member.
    527 
    528 @item MHD_REQUEST_INFO_DYNAMIC_NUMBER_COOKIES
    529 Get the number of cookies in the request.
    530 The result is placed in the @var{v_sizet} member.
    531 
    532 @item MHD_REQUEST_INFO_DYNAMIC_HEADER_SIZE
    533 Return length of the client's HTTP request header.
    534 This is a total raw size of the plaintext header. 
    535 The result is placed in the @var{v_sizet} member.
    536 
    537 @item MHD_REQUEST_INFO_DYNAMIC_NUMBER_POST_PARAMS
    538 Get the number of decoded POST entries in the request.
    539 The result is placed in the @var{v_sizet} member.
    540 
    541 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_PRESENT
    542 Get whether the upload content is present in the request.
    543 The result is @code{MHD_YES} if any upload content is present, even
    544 if the upload content size is zero.
    545 The result is placed in the @var{v_bool} member.
    546 
    547 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_CHUNKED
    548 Get whether the chunked upload content is present in the request.
    549 The result is @code{MHD_YES} if chunked upload content is present.
    550 The result is placed in the @var{v_bool} member.
    551 
    552 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TOTAL
    553 Get the total request body size.
    554 Results in zero if no body is expected to be uploaded,
    555 @code{MHD_SIZE_UNKNOWN} if the size is not known
    556 (for example, in the case of a chunked upload).
    557 The result is placed in the @var{v_uint64} member.
    558 
    559 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_RECIEVED
    560 Get the total size of the content upload already received from the client.
    561 This is the total size received, it is possible that some of it has
    562 not yet been seen or fully processed by the application.
    563 The result is placed in the @var{v_uint64} member.
    564 
    565 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TO_RECIEVE
    566 Get the total size of the content upload left to be received from
    567 the client.
    568 Results in @code{MHD_SIZE_UNKNOWN} if total size is not known
    569 (for example, in case of a chunked upload).
    570 The result is placed in the @var{v_uint64} member.
    571 
    572 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_PROCESSED
    573 Get the total size of the content upload already processed (upload callback
    574 called and completed (if any)).
    575 If the value is requested from @code{MHD_UploadCallback}, then result does @emph{not}
    576 include the data currently being processed by the callback.
    577 The result is placed in the @var{v_uint64} member.
    578 
    579 @item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TO_PROCESS
    580 Get the total size of the content upload left to be processed.
    581 The resulting value includes the size of the data not yet received from
    582 the client.
    583 If the value is requested from @code{MHD_UploadCallback}, then result includes
    584 the current data being processed by the callback.
    585 Resulted in @code{MHD_SIZE_UNKNOWN} if total size is not
    586 known (for example, in the case of a chunked upload).
    587 The result is placed in the @var{v_uint64} member.
    588 
    589 @c FIXME: should this not be removed?
    590 @item MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_USERNAME
    591 Returns pointer to information about username in client's digest auth
    592 request.
    593 The resulting pointer is @code{NULL} if no digest auth header is set by
    594 the client, the format of the digest auth header is broken, no
    595 username is provided or the format of the username parameter is broken.
    596 Pointers in the returned structure (if any) are valid until response
    597 is provided for the request.
    598 The result is placed in the @var{v_auth_digest_uname} member.
    599 
    600 @anchor{MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO}
    601 @item MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO
    602 Returns pointer to information about digest auth in client request.
    603 The resulting pointer is @code{NULL} if no digest auth header is set by
    604 the client or the format of the digest auth header is broken.
    605 Pointers in the returned structure (if any) are valid until response
    606 is provided for the request.
    607 The result is placed in the @var{v_auth_digest_info} member.
    608 
    609 @anchor{MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS}
    610 @item MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS
    611 Returns information about Basic Authentication credentials in the request.
    612 Pointers in the returned structure (if any) are valid until
    613 any @code{struct MHD_Action} or @code{struct MHD_UploadAction}
    614 is provided. If the data is needed beyond this point,
    615 it must be copied to an application buffer before providing the action.
    616 If @code{MHD_request_get_info_dynamic_sz()} returns @code{MHD_SC_OK} then
    617 @var{v_auth_basic_creds} is not @code{NULL} and at least the username 
    618 is provided.
    619 The result is placed in the @var{v_auth_basic_creds} member.
    620 @end table
    621 @end deftp
    622 
    623 
    624 @c FIXME: again, we should use semantic names, not type-based names!
    625 @anchor{MHD_RequestInfoDynamicData}
    626 @deftp {C Union} MHD_RequestInfoDynamicData
    627 Stores dynamic information about a request.
    628 
    629 @table @var
    630 @item @code{struct MHD_String} v_str
    631 Used when the requested information is a string.
    632 
    633 @item @code{size_t} v_sizet
    634 Used when the requested information is a size.
    635 
    636 @item @code{enum MHD_Bool} v_bool
    637 Used when the requested information is a boolean.
    638 
    639 @item @code{uint_fast64_t} v_uint64
    640 Used when the requested information is an unsigned 64-bit integer.
    641 
    642 @item @code{const struct MHD_AuthDigestUsernameInfo *} v_auth_digest_uname
    643 Information about client-provided username for digest authentication.
    644 
    645 @item @code{const struct MHD_AuthDigestInfo *} v_auth_digest_info
    646 Information about client's digest authentication.
    647 
    648 @item @code{const struct MHD_AuthBasicCreds *} v_auth_basic_creds
    649 The username and password provided by the client's basic authentication header.
    650 If @code{MHD_request_get_info_dynamic_sz()} returns
    651 @code{MHD_SC_OK} then this pointer is not @code{NULL} and
    652 at least the @var{username} is provided.
    653 @end table
    654 @end deftp