Parse a URI String into Name-Value Collection

前端 未结 19 2468
难免孤独
难免孤独 2020-11-22 01:34

I\'ve got the URI like this:

https://google.com.ua/oauth/authorize?client_id=SS&response_type=code&scope=N_FULL&access_type=offline&redirect_         


        
19条回答
  •  借酒劲吻你
    2020-11-22 02:02

    For Android, if you are using OkHttp in your project. You might get a look at this. It simple and helpful.

    final HttpUrl url = HttpUrl.parse(query);
    if (url != null) {
        final String target = url.queryParameter("target");
        final String id = url.queryParameter("id");
    }
    

提交回复
热议问题