Decoding URI query string in Java

后端 未结 5 472
离开以前
离开以前 2020-12-05 09:50

I need to decode a URI that contains a query string; expected input/output behavior is something like the following:

abstract class URIParser
{       
    /*         


        
5条回答
  •  没有蜡笔的小新
    2020-12-05 10:48

    new java.net.URI(proxyRequestParam).getPath()
    

    The string encoded by js encodeURIComponent should just be a path, without schema and other things. However it still a valid input for java.net.URI. So java.net.URI will do everything for us and then the path of it is what we want.

提交回复
热议问题