Searches for a message-header with the specified field-name.
- Parameters
-
[in] | head | Where to start searching in the message received from the server. This function actually ignores the line to which head points, and starts searching from the next line. Therefore, when parsing an HTTP message, head should initially point to the start-line, e.g. "HTTP/1.1 200 OK". Alternatively, if the caller has already found a message-header and wants to know if there are any more message-headers with the same field-name, then head can be the pointer that a previous call stored in *ptr. |
[in] | item | The field-name for which this function searches. |
[out] | ptr | If ptr is not NULL, and this function finds a message-header, then this function stores in *ptr the address at which the field-content begins; the caller may pass that as head in a later call. Otherwise, this function does not modify *ptr. |
- Returns
- NULL if not found or out of memory. Otherwise, a copy of the field-content of the message-header; the caller must eventually mem_free() it.
The terms message-header, field-name, start-line, and field-content are defined in RFC 2616 sections 4.1 and 4.2.