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:31 am (UTC)
From: [identity profile] juan-gandhi.livejournal.com
Why would not it catch the case?
And I despise the whole Apache HttpClient anyway.

Date: 2014-08-12 04:34 am (UTC)
From: [identity profile] jdevelop.livejournal.com
because you have multiple values for same parameter, which is legal - and you'r code will get only last one.

as for & - this is a valid code block for encoding the ampersand in the parameter name or value.

Date: 2014-08-12 05:06 am (UTC)
From: [identity profile] juan-gandhi.livejournal.com
Right. Well, have to think about it.

Date: 2014-08-13 01:00 am (UTC)
From: [identity profile] http://users.livejournal.com/_xacid_/
use List[(String, String)] as result

:)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

July 2025

S M T W T F S
  12345
6789 1011 12
131415 1617 1819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 20th, 2025 09:11 pm
Powered by Dreamwidth Studios