juan_gandhi: (VP)
[personal profile] juan_gandhi
  def parameters(href): Map[String, String] = href split("\\?",2) toList match {
    case url::params::Nil => params.split("&") map (_ split "=" toList) collect {
      case k::v::Nil => k->v
    } toMap

    case otherwise => Map.empty  
  }


Or?...

Date: 2014-08-12 04:27 am (UTC)
From: [identity profile] jdevelop.livejournal.com
wouldn't catch the case when param1=value1&param1=value2

also & will break everything

I'd suggest to use URL from Apache HttpClient.
Edited Date: 2014-08-12 04:27 am (UTC)

Date: 2014-08-12 08:53 pm (UTC)
From: [identity profile] yussouf.livejournal.com
what does these toLists toMaps cost?

Date: 2014-08-13 12:24 am (UTC)
From: [identity profile] http://users.livejournal.com/_xacid_/
why not parsers combinators? :)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 29th, 2025 10:27 pm
Powered by Dreamwidth Studios