diff --git a/src/deprecated.jl b/src/deprecated.jl index 466fd1867..8f8b56a87 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -96,7 +96,7 @@ function legacy_response( end end - body = String(copy(body)) + body_str = String(copy(body)) if occursin(r"/xml", mime) if return_headers @@ -118,8 +118,8 @@ function legacy_response( end xml_dict_type = response_dict_type{Union{Symbol,String},Any} - body = parse_xml(body) - root = XMLDict.root(body.x) + xml = parse_xml(body_str) + root = XMLDict.root(xml.x) return ( if return_headers @@ -147,8 +147,7 @@ function legacy_response( ) end - info = - isempty(body) ? nothing : JSON.parse(body; dicttype=response_dict_type) + info = isempty(body) ? nothing : JSON.parse(body_str; dicttype=response_dict_type) return (return_headers ? (info, response_dict_type(response.headers)) : info) elseif startswith(mime, "text/") if return_headers @@ -169,7 +168,9 @@ function legacy_response( ) end - return (return_headers ? (body, response_dict_type(response.headers)) : body) + return ( + return_headers ? (body_str, response_dict_type(response.headers)) : body_str + ) else if return_headers Base.depwarn(