Hi,
I'm quite new in C# so it can be a silly question, but i can't figure
how to make a req/resp and a second req with first response's
informations... What I mean:
I have no problem in sending a request to a web server, and getting
response from it, reading headers, cookies, body etc... but how can i
make a seconde request using the first communication with HttpWebRequest
and HttpWebResponse.
What exactly i am trying to do is:
connect to the server X,
get a response and cookie information,
send username email and password to X/login.php with POST data and
appropriate cookies...
get a OK message,
just 4 step
thanks a lot
PS: any tutorial about the subject would be appreciated 2 1850
For cookies, you need to instantiate a CookieContainer class and
assign the object to the CookieContainer property of all the
WebRequest object needing to share the cookies.
As for the rest of the response, do you need data inside of input
fields to POST back? The only way to really do this is to scrape it
out using RegEx or String.IndexOf.
I have some examples here: http://odetocode.com/Articles/162.aspx
--
Scott http://www.OdeToCode.com/blogs/scott/
On Thu, 11 Nov 2004 03:07:05 +0200, Ziphyre <no****@yahoo.com> wrote: Hi,
I'm quite new in C# so it can be a silly question, but i can't figure how to make a req/resp and a second req with first response's informations... What I mean:
I have no problem in sending a request to a web server, and getting response from it, reading headers, cookies, body etc... but how can i make a seconde request using the first communication with HttpWebRequest and HttpWebResponse.
What exactly i am trying to do is: connect to the server X, get a response and cookie information, send username email and password to X/login.php with POST data and appropriate cookies... get a OK message, just 4 step
thanks a lot
PS: any tutorial about the subject would be appreciated
Thanks,
useful examples...
Scott Allen wrote: For cookies, you need to instantiate a CookieContainer class and assign the object to the CookieContainer property of all the WebRequest object needing to share the cookies.
As for the rest of the response, do you need data inside of input fields to POST back? The only way to really do this is to scrape it out using RegEx or String.IndexOf.
I have some examples here: http://odetocode.com/Articles/162.aspx
-- Scott http://www.OdeToCode.com/blogs/scott/
On Thu, 11 Nov 2004 03:07:05 +0200, Ziphyre <no****@yahoo.com> wrote:
Hi,
I'm quite new in C# so it can be a silly question, but i can't figure how to make a req/resp and a second req with first response's informations... What I mean:
I have no problem in sending a request to a web server, and getting response from it, reading headers, cookies, body etc... but how can i make a seconde request using the first communication with HttpWebRequest and HttpWebResponse.
What exactly i am trying to do is: connect to the server X, get a response and cookie information, send username email and password to X/login.php with POST data and appropriate cookies... get a OK message, just 4 step
thanks a lot
PS: any tutorial about the subject would be appreciated
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: gizmo |
last post by:
Hi,
I'm using the following code to request the html source from the
quoted site.
......
string url = "http://www1.soccerstand.com/";
WebRequest webRequest = WebRequest.Create(url);...
|
by: Paul |
last post by:
Hello,
First I want to refer to the problem "WebRequest : execute a button" of
a few days ago.
The way I solved it, I loose my session, and as a consequence my
session variables. I don't want...
|
by: John K. |
last post by:
Hi
I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the...
|
by: IronYuppie |
last post by:
Hi all--
I'm retrieving contents from my site using the retrieving images from the
database method listed here:
...
|
by: ThyRock |
last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API.
This service uses a DLL file (ShippingAPITest.dll) with a query string which
includes XML.
The web service accepts...
|
by: Gordon |
last post by:
I use the following code to get source HTML. The second line seems to work
when I get no response from a site. However, I want to stop the request if
it's taking more than 20 - 30 seconds. I can't...
|
by: Savas Ates |
last post by:
I have a vb.net web application. I want to post some variables to another
web page and take some values back and process them.
This is codes in my target url. I should post "langpair" cariable...
|
by: kkb |
last post by:
Hello!
First, I'm sorry because of my english... I'll try to be
understandable!
I've got a strange problem using .NET 2003 C# and I haven't figured it
out for a long time. I'm implementing an...
|
by: Mr Flibble |
last post by:
OK I logon to a web site and I manage to get an SMSESSION cookie that I
then store in a variable called _session (a class scoping variable). I
do this by calling a logon URL and setting a cookie...
|
by: Zytan |
last post by:
I know that WebRequest.GetResponse can throw WebException from
internet tutorials. However in the MSDN docs:
http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx
It...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |