Exemplo n.º 1
0
 static void ParseCookie(string cookieHeader, HttpDict cookies)
 {
     foreach (var cookie in cookieHeader.Split(';'))
     {
         int index = cookie.IndexOf('=');
         if (index > 0)
         {
             cookies[cookie.Substring(0, index).Trim()] = cookie.Substring(index + 1).Trim();
         }
     }
 }
Exemplo n.º 2
0
 public static void ParseQueryString(string query, HttpDict queryStrings)
 {
     foreach (var q in query.Split('&'))
     {
         int keyIndex = q.IndexOf('=');
         if (keyIndex >= 0)
         {
             queryStrings[q.Substring(0, keyIndex)] = q.Substring(keyIndex + 1);
         }
         else if (q != "")
         {
             queryStrings[q] = "";
         }
     }
 }