Form encoded data

How can I reproduce this python code with HTTP.jl?

url = ''
params = {'par': val}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
with open(filename, 'rb') as f:
    r =, headers=headers, params=params, data={'file':})

What I have

uri = HTTP.URI(;
    scheme = "https",
    host = "",
    path = "/api",
    query = Dict("par" => val))

r= open(filename) do file
        ["Content-Type" => "application/x-www-form-urlencoded"],
        HTTP.Form(Dict("file" => read(file, String))))

But unfortunately it does not work.