kip
ex_cldr Core Team
URL parser for non-HTTP URLs
ex_url parses URLs like URI but it adds parsing of non-HTTP URL’s and parsing for URL parameters.
It currently knows how to parse tel:, uuid:, urn:, mailto:, data: and geo: URIs.
Examples
# Parse a geo: URI
iex> URL.parse("geo:48.198634,-16.371648,3.4;crs=wgs84;u=40.0")
%URL{
authority: nil,
...
parsed_path: %URL.Geo{
alt: 3.4,
lat: 48.198634,
lng: -16.371648,
params: %{"crs" => "wgs84", "u" => 40.0}
},
path: "48.198634,-16.371648,3.4;crs=wgs84;u=40.0",
port: nil,
...
}
# Parse a mailto: URI
iex> mailto = URI.parse("mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO")
iex> URL.Mailto.parse(mailto)
%URL.Mailto{
params: %{"body" => "NATTO", "subject" => "Test"},
to: ["user@納豆.example.org"]
}
# Parse a data: URI
iex> data = URI.parse "data:text/plain;base64,SGVsbG8gV29ybGQh"
iex> URL.Data.parse(data)
%URL.Data{
data: "Hello World!",
mediatype: "text/plain",
params: %{"encoding" => "base64"}
}
# Parse a tel: URI
iex> tel = URI.parse "tel:+61-0407-555-987"
iex> URL.Tel.parse(tel)
%URL.Tel{params: %{}, tel: "+61 407 555 987"}
Popular in Discussions
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
Hello everyone,
I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in.
phx.gen...
New
Hi all,
I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Hello,
I want to share a project I’ve been working on for a while:
https://github.com/almightycouch/gitgud
Background
Some time ago I ...
New
Let me start by stating an assumption: Phoenix is a great approach to building REST APIs. There are many reasons for this, but I will ass...
New
I’ve been hearing much about the new formatter and it’s something I have been keen to try.
I find examples buy far the most illuminating...
New
I would like to spark a discussion about the static access operator: ..
For whom does not know: it is used in Elixir to access fields of...
New
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
Other popular topics
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I’m writing a test for one of the...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
I would like to know what is the best IDE for elixir development?
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








