Nim: How to parse a URL/URI | Glenn Gillen
Nim: How to parse a URL/URI

Nim: How to parse a URL/URI

Mar 22, 2022

Parsing a URL into its contituent parts is possible via uri module in the stdlib:

import std/uri
let myUri = parseUri("https://alice:secrets@glenngillen.com:8080/foo?q=bar#baz")
echo myUri.scheme # https
echo myUri.username # alice
echo myUri.password # secrets
echo myUri.hostname # glenngillen.com
echo myUri.port # 8080
echo myUri.path # /foo
echo myUri.query # q=bar
echo myUri.anchor # baz
Hi, I'm Glenn! 👋 I've spent most of my career working with or at startups. I'm currently the Director of Product @ Ockam where I'm helping developers build applications and systems that are secure-by-design. It's time we started securely connecting apps, not networks.

Previously I led the Terraform product team @ HashiCorp, where we launched Terraform Cloud and set the stage for a successful IPO. Prior to that I was part of the Startup Team @ AWS, and earlier still an early employee @ Heroku. I've also invested in a couple of dozen early stage startups.