Switch from URI to Uri.

URI does not allow braces: {}, even though they are allowed in the spec.
It is also easier to build paths using a Uri instance.

Download/upload progress should be done with longs for large transfers.