473,388 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Want to call a custom handler that redirect and receive the http return code (302, 303 or 307)

Hi,
I want to use a class (if possible other than Socket) which one I could call
a custom handler and receive the redirect code it sends...

Actually, I tried using the WebClient class, but when the WebClient is
redirected, it does not give the redirect code in the result, it
automaticaly redirects and put the resulting page into the result...

Is there a buit-in class that does what I need in the .Net Framework or will
I have to implement the HTTP protocol myself using the Socket class?

thanks

ThunderMusic
Jan 26 '07 #1
1 1365
use HttpWebRequest and turn off AllowAutoRedirect.
-- bruce (sqlwork.com)
ThunderMusic wrote:
Hi,
I want to use a class (if possible other than Socket) which one I could call
a custom handler and receive the redirect code it sends...

Actually, I tried using the WebClient class, but when the WebClient is
redirected, it does not give the redirect code in the result, it
automaticaly redirects and put the resulting page into the result...

Is there a buit-in class that does what I need in the .Net Framework or will
I have to implement the HTTP protocol myself using the Socket class?

thanks

ThunderMusic

Jan 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Philipp Lenssen | last post by:
I have a problem doing a permanent redirect. It works only if I directly send the new location header (third line in sample below) but never in combination with sending a "301 Moved permanently"...
2
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
14
by: sinister | last post by:
I have some CGI programs that spit out error pages when the user enters illegal form input. These custom error pages, while informing the user of errors, are otherwise just standard web pages. ...
5
by: Shelly | last post by:
hi, I am trying to create a custom HTTP header and trying to access that variable on another ASP.NET webpage. Following is the code base- I use the following code to set the header...
6
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
1
by: Julie | last post by:
I created my own custom 404 handler and it works, so when I put in http://www.domain.com/badxxx.html it produces the correct 404 error and you see http://www.domain.com/badxxx.html in the url...
2
by: lawrence k | last post by:
Not especially a PHP question, but how does one indicate a 302 redirect? Or does Apache do that automatically if I use PHP to send a location header? On Accumulist, if you click a title, you go...
1
by: enaeher | last post by:
Hello, I'd like to be able to detect whether the browser is receiving an HTTP status 302 redirect when handling the response to an Ajax call. I can see the 302 status code clearly with...
1
by: ThunderMusic | last post by:
Hi, I want to use a class (if possible other than Socket) which one I could call a custom handler and receive the redirect code it sends... Actually, I tried using the WebClient class, but when...
0
by: walve_wei | last post by:
<1>use the D3D control panel, enable the debug DLL and maximum validation,for D3D control panel ,you need to install the directx sdk. <2>Start up the debug monitor (<MSVC install...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.