Suggested a method to reply to a http_request with the contents of a notecard with some simple templating options.
llHTTPRespondWithNotecard(request_id, notecard_id_or_name, list_of_tokens_and_substitutions);
request_id
being the key of the request
notecard_id_or_name
being a natecard key or name of one in the objects inventory
list_of_tokens_and_substitutions
being a strided key value pair list of tokens to substitute in the notecards content
e.g A script doing
http_request( key request_id, string method, string body )
{
llHTTPRespondWithNotecard(
request_id,
"content",
[
"%%A%%", "Hello",
"%%B%%", "World"
]
);
}
With a notecard in it's object inventory called "content" containing
%%A%% %%B%%!!!
%%A%% %%B%%!!!
%%A%% %%B%%!!!
Would serve the http content of
Hello World!!!
Hello World!!!
Hello World!!!
To the request.
This sort of feature was discussed a few times a Simulator User Groups