ghttp_parser_create()
#
Creates and initializes a new GHTTP_PARSER
instance for parsing HTTP messages. The parser processes incoming HTTP data and triggers events when headers, body, or complete messages are received.
Prototype
GHTTP_PARSER *ghttp_parser_create(
hgobj gobj,
enum http_parser_type type,
gobj_event_t on_header_event,
gobj_event_t on_body_event,
gobj_event_t on_message_event,
BOOL send_event
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The parent GObj that will handle the parsed HTTP events. |
|
|
The type of HTTP parser ( |
|
|
The event triggered when HTTP headers are fully received. |
|
|
The event triggered when a portion of the HTTP body is received. |
|
|
The event triggered when the entire HTTP message is received. |
|
|
If |
Return Value
A pointer to the newly created GHTTP_PARSER
instance, or NULL
if memory allocation fails.
Notes
The returned GHTTP_PARSER
instance must be destroyed using ghttp_parser_destroy()
when no longer needed.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples