Do colons require encoding in URI query parameters?

前端 未结 2 1206
走了就别回头了
走了就别回头了 2021-02-04 01:12

I\'ve noticed that Java\'s UriBuilder isn\'t encoding the : characters included in my query parameter values (ISO 8601-formatted strings).

Acco

2条回答
  •  迷失自我
    2021-02-04 02:01

    Yes, they should be encoded in a query string. The correct encoding is %3A

    However, I can understand why UriBuilder isn't encoding :. You don't want to encode the colon after the protocol (eg http:) or between the username and password (eg ftp://username:password@domain.com) in an absolute URI.

提交回复
热议问题