# Curl -d data url from Julia

**URL:** <https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975>\
**Category:** General Usage\
**Tags:** libcurl, http\
**Created:** [October 8, 2025, 12:30pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975 "2025-10-08T12:30:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 8, 2025, 12:30pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/1 "2025-10-08T12:30:33Z")

</div>

I would like to do the equivalent of

```julia
run(`curl -d data url`)

```

from Julia, using LibCURL or one of the wrappers. Is there a simple way to do this?

(Motivation: `curl` may not be available on the host, but I have a working Julia environment.)

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [October 8, 2025, 12:37pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/2 "2025-10-08T12:37:24Z")

</div>

I think that CURL\_jll.jl provides the `curl` executable.

So it _might_ just be as simple as:

```julia
using CURL_jll: curl

run(`$(curl()) ...`)

```

(I haven’t tested this.)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [October 8, 2025, 12:42pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/3 "2025-10-08T12:42:30Z")

</div>

Any reason for not using `Downloads.download`?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 8, 2025, 12:57pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/4 "2025-10-08T12:57:11Z")

</div>

Can I provide data to be sent with that?

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [October 8, 2025, 1:06pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/5 "2025-10-08T13:06:02Z")

</div>

```julia
using HTTP
headers = []
data = Dict("key" => "value")
HTTP.post(url, headers, data)

```

This should work.

Edit: curl seems to set a few headers by default, so you might want to consider

```julia
headers = ["Accept" => "*/*"]

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 8, 2025, 1:27pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/6 "2025-10-08T13:27:57Z")

</div>

What should `"key"` be to be equivalent to `data` in `curl -d data`?

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [October 8, 2025, 1:42pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/7 "2025-10-08T13:42:03Z")

</div>

I assumed `data` was a placeholder. You can simply pass

```julia
HTTP.post(url, [], "data")

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 8, 2025, 1:46pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/8 "2025-10-08T13:46:10Z")

</div>

Thanks, that works just great!

(In case someone is curious: I am using this at the end of a script to notify myself about the end of a computation with [https://ntfy.sh/](https://ntfy.sh/))

---

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [October 8, 2025, 11:21pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/9 "2025-10-08T23:21:17Z")

</div>

> [@Tamas\_Papp](#):
>
> (In case someone is curious: I am using this at the end of a script to notify myself about the end of a computation with [https://ntfy.sh/](https://ntfy.sh/))

Thanks for this. I have been using Telegram ([GitHub - Arkoniak/Telegram.jl: Native Julia Telegram bot api wrapper](https://github.com/Arkoniak/Telegram.jl)) for notifications. But it’s good to have other options.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 9, 2025, 1:43pm UTC](https://discourse.julialang.org/t/curl-d-data-url-from-julia/132975/10 "2025-10-09T13:43:15Z")

</div>

I learned about nfty.sh in [this topic](https://discourse.julialang.org/t/send-notification-my-server-when-computation-is-done/129142), which I think lists all the feasible options. What I like about ntfy.sh is how lightweight the setup is — I just generate a random hex string, and use it as a channel with HTTP.
