Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chhoda

macrumors 6502
Original poster
Hi All,

Can I do the following in http ? how ?

how can i post an useragent in my http request ?
how can i post an referer in my http request ?
is there a regex type which I can use to find patterns in an http response ?


regards
CH
 
bit more clearer

Let me be bit cleaer. I found a regex framework, i can use that probably for regex.

I need to translate a piece of c# code which works for me

NameValueCollection postToLogin = new NameValueCollection();
postToLogin.Add("login", login);
postToLogin.Add("passwd", credential.Password);

webClient.Headers[HttpRequestHeader.UserAgent] = _userAgent;
webClient.Headers[HttpRequestHeader.Referer] = _loginPage;
webClient.Encoding = Encoding.UTF8;
webClient.Headers[HttpRequestHeader.Cookie] = webClient.ResponseHeaders[HttpResponseHeader.SetCookie];

webClient.UploadValues(_authUrl, postToLogin);
string cookie = webClient.ResponseHeaders[HttpResponseHeader.SetCookie];


any ideas please

--CH
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.