开发者

How to get url parameters values from HTTPRequest in Apache HTTPClient

开发者 https://www.devze.com 2023-03-09 04:54 出处:网络
I would like to take value of specific parameter in quer开发者_Python百科y string. Is there any method in HttpClient which can do if for me (ex. util class method) or I have to write my own?In 4.X.X t

I would like to take value of specific parameter in quer开发者_Python百科y string. Is there any method in HttpClient which can do if for me (ex. util class method) or I have to write my own?


In 4.X.X there is:

    List<NameValuePair> parameters = URLEncodedUtils.parse(new URI(
                request.getRequestLine().getUri()), HTTP.UTF_8);

        for (NameValuePair nameValuePair : parameters) {
            System.out.println(nameValuePair.getName() + ": "
                    + nameValuePair.getValue());
        }

Then handle your own parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消