Exemple #1
0
        private async Task <Tuple <string, string> > GetStationAlert(string startStationId, DateTime date, string setCookies, Uri uri, HttpConnector httpConnector, HttpConnector.UserAgent userAgent)
        {
            CookieContainer cookies = new CookieContainer();

            if (!string.IsNullOrWhiteSpace(setCookies))
            {
                string phpSessionId = "PHPSESSID";
                cookies.Add(uri, new Cookie(phpSessionId, GetValueFromCookieString(phpSessionId, setCookies)));
            }
            cookies.Add(uri, new Cookie("eic_login", "0"));
            alertStations.SetParameter("date", string.Format("{0:YYYY-MM-dd+HH:mm}", date), false);
            alertStations.SetParameter("station[]", startStationId);
            Tuple <string, string> startStation = await httpConnector.GetResponseAsync(
                alertStations.GetUri(),
                alertStations.GetAllParameters(),
                cookies,
                referer,
                HttpConnector.HttpMethod.Get,
                userAgent
                );

            return(startStation);
        }