Closed prabirshrestha closed 13 years ago
willing to review a pull request on this if you want to implement it.
i could write the code for it, but what should be the return type for
public static IDictionary<string, List<string>> ParseQueryString(string query)
IDictionary<string, List<string>> or Dictionary<string,List<string>> or NameValueCollection (i don't prefer this one coz, namevaluecollection doesnt work in silverlight and windows phone) or just IDictionary<string,string> (this one has a defect, in the sense, ?id=123&name=asd&id=234 if the querystring (id) appears twice then it wont work. wierd case though)
can you start a discussion the google group? thanks!
discussion created at google groups: http://groups.google.com/group/restsharp/browse_thread/thread/418b236edef573d2#
please use google groups for further discussion.
I think its a good idea to expose ParseUrlQueryString also, especailly when dealing with OAuth2.
they return results in. https:\/\/graph.facebook.com\/1237476932\/feed?limit=25&oauth_token=1314033135-100001241534829%7C1237417Cq_Jgbyd1L87YiLi-ZAfyFo.&until=2010-07-12T09%3A53%3A41%2B0000
so extracting appropriate querystring would be helpful if restsharp already contains this method. desktop supports public static NameValueCollection ParseQueryString(string query) from HttpUtility class but silverlight doesn't. it then becomes problem of writing custom method for silverlight. another problem with silverlight is that it doesn't support the class NameValueCollection. after checking the QueryString in silverlight it seems to rather return IDictionary<string,string> which i think is pretty reasonable. so mite be Restsharp can have a function called
public static IDictionary<string,string> ParseQueryString(string query)
so that it works in both desktop and silverlight using the same api.
or if it wants to mimic the feature of NameValueCollection IDictionary<string,string[]> or IDictionary<string,List> might be appropriate.
anyways heres the code, did a slight change from the mono HttpUtility code.
public static IDictionary<string, List> ParseQueryString(string query)
{
var result = new Dictionary<string, List>();