# Form encoded data

**URL:** https://discourse.julialang.org/t/form-encoded-data/31869
**Category:** Web Stack
**Tags:** question
**Created:** [December 4, 2019, 7:51pm UTC](https://discourse.julialang.org/t/form-encoded-data/31869 "2019-12-04T19:51:24Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)
#### Post date: [December 4, 2019, 7:51pm UTC](https://discourse.julialang.org/t/form-encoded-data/31869/1 "2019-12-04T19:51:24Z")

</div>

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

```python
url = 'https://myurl.com/api'
params = {'par': val}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
with open(filename, 'rb') as f:
    r = requests.post(url, headers=headers, params=params, data={'file': f.read()})

```

What I have

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

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

```

But unfortunately it does not work.

---

_[View the full topic](https://discourse.julialang.org/t/form-encoded-data/31869)._
