Giter Site home page Giter Site logo

Comments (2)

theon avatar theon commented on August 26, 2024

Good point. Thanks!

I'd like a better way to do percent encoding than the current use of java.net.URI. Maybe something RFC 3986 aware, but I haven't been able to find any existing libraries (suggestions welcome). I think I'll look writing some custom code to do percent encoding and ask for feedback here.

I'd also like to add configuration for the encoding via an `implicit val'. For example the default config would do percent encoding on spaces:

    val uri = "http://example.com" ? ("p1" -> "p one")
    uri.toString //http://example.com?p1=p%20one

But an implicit val can be added to encode spaces as pluses:

    implicit val uriConfig = DefaultConfig + SpacePlusEncode

    val uri = "http://example.com" ? ("p1" -> "p one")
    uri.toString //http://example.com?p1=p+one

And similar configs for encoding lists as token separated (p=1,2,3) vs multiple key value pairs (p=1&one=2&one=3) etc. What do you think about this approach?

from scala-uri.

theon avatar theon commented on August 26, 2024

Issue #3 has been merged in. I've also committed some changes to use a custom percent encoding algorithm rather than anything JDK provided to allow customised encoding, for example, encoding spaces as pluses

from scala-uri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.