mP1 / walkingkooka-net

Beautiful type safe networking abstractions mostly concentrating on http.
Apache License 2.0
0 stars 1 forks source link

UrlQueryString.replaceParameter(name, values) #446

Open mP1 opened 8 months ago

likeabantha commented 3 months ago

@mP1 - can you please elaborate on what is expected behavior for this method. Thanks!

mP1 commented 3 months ago

There are two options, havent thought it through yet.

My thoughts are should replace ALWAYS work or ONLY work if NAME exists...

  1. Replace the old values with the new values ONLY if name exists

old

abc=xyz&def=123

replace 
"abc=999"

becomes 
abc=999&def=123
  1. Delete any old values if they exist and then unconditionally "set" old
    
    def=123

replace abc=999

becomes abc=999&def=123



ALWAYS does both 1 & 2
ONLY does 1 for 2 it would not change anything.