Passing password from Base.getpass\Base.winprompt to HTTP.request

FINAL UPDATE:

I believe, I have this figured out. The HTTP.jl documentation had the final answer for me. Here is what the final code looks like:

user = "username"
x = Base.getpass("Enter the password")
passwd = read(x, String)
auth = Base64.base64encode(user * ":" * passwd)

baseurl = "https://user:passwd@www.notawebsite.com/"
endpoint = "rest/endpoint"
params_diction = Dict("fields"=>fields)

r = HTTP.request("GET", baseurl * endpoint, ["Authorization" => "Basic $(auth)"], query = params_diction)
json_resp = JSON.parse(String(r.body))
println(json_resp)
2 Likes