My application registers the data of each HTTP request in several MySQL tables through a stored procedure that returns a unique request identifier to the application.
CALL http_req('ip', 'url', 'method', 'timestamp', @error, @request_id);
Now I also want to write all the headers of the HTTP requests to the table, each header on a separate line:
CREATE TABLE `http_header` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`request_id` INT(10) UNSIGNED NOT NULL,
`name` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`value` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
PRIMARY KEY (`id`))
The problem is that each client has different numbers and types of headers. I did not find a way to transfer all the header data to my stored procedure, and then paste them into the above table.
Currently, I need to generate and execute a second insert request from my application after calling a stored procedure to save the headers:
INSERT INTO http_header (request_id, name, value)
VALUES (20153, 'cache-control', 'max-age=0'),
(20153, 'accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'),
(20153, 'accept-encoding', 'gzip,deflate,sdch');
? ?