NET-A-PORTER / scala-uri

Simple scala library for building and parsing URIs
Other
261 stars 33 forks source link

How do I remove a protocol / scheme from a URI? #82

Closed wsargent closed 9 years ago

wsargent commented 9 years ago

I'd like to create a protocol relative URL from an absolute URL, but I don't see a way to do that from the documentation. Is this possible?

philwill-nap commented 9 years ago

Try this in the REPL:

import com.netaporter.uri._
val absoluteUri = Uri.parse("scheme://host/path")
val protocolRelativeUri = absoluteUri.copy(scheme=None)