I think you need to `encodeURIComponent` the key as well.