Add a GET query parameter to a given URL or update if it already exists

http:add_query_param_to_url(STRING url
, STRING query_param_name
, STRING query_param_value)

http:add_query_param_to_url("https://www.example.com/test.html?z=4#foo", "y", 'oeunth')
#=> "https://www.example.com/test.html?z=4&y=oeunth#foo"

http:add_query_param_to_url("https://www.example.com/test.html?y=4", "y", 'this is nice')
#=> "https://www.example.com/test.html?y=this+is+nice"


http:add_query_param_to_url("https://www.example.com/test.html?y=4", "", '')
#=> "https://www.example.com/test.html?y=4"

Copyright ©2013-2022 SunSed®. All rights reserved.