db536bad90
- Adds a new parameter `response_encoding` to the fetch function. - This parameter allows the user to specify a charset for decoding the response body. - It supports all standard web encodings, and also `hex` and `base64`. - If no encoding is specified, the response is decoded as utf-8, or as base64 if it contains binary data.
10 lines
299 B
SQL
10 lines
299 B
SQL
set res = sqlpage.fetch('{
|
|
"url": "http://localhost:' || $echo_port || '/hello_world",
|
|
"response_encoding": "hex"
|
|
}');
|
|
select 'text' as component,
|
|
case
|
|
when $res LIKE '474554202f68656c6c6f5f776f726c64%' then 'It works !'
|
|
else 'It failed ! Got: ' || $res
|
|
end as contents;
|