See https://www.swi-prolog.org/pldoc/doc_for?object=atom_json_dict/3. As with most text conversion predicates, anything text-like is accepted as input.
P.s. Pushed a fix to use the newer open_string/2 rather than memory files for better performance, allowing list of character (codes) and raising an exception on illegal input.
P.s. “String bound to a variable” doesn’t make sense in Prolog. A term can be a variable or a string (or some more things), but once a variable term is unified with a string it is a string. The variable simply doesn’t exist anymore. Logical variables are not like buckets in imperative languages in which you store something.
 This stuff should eventually be moved outside the HTTP package.