{:k3 nil, k4 "a"} => should be k3&k4=a
or k3=&k4=a

nil or empty can not be removed, it's fine for them in url, server will get empty string for them.