473,406 Members | 2,713 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,406 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 1349
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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
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,...
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
jinu1996
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.