Files
sqlpage--sqlpage/tests/sql_test_files/it_works_fetch_hex.sql
lovasoa db536bad90 feat: Add encoding parameter to fetch function
- 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.
2025-08-21 23:27:33 +02:00

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;