473,545 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest and "Too many automatic redirections"

This doesn't happen on my development machine (code works perfectly) but on the client's machine, I get an error reported that "too many automatic redirections". I've tried setting the maximum to a large number without prevail.

I used InternetOpenURL in the past (VB6) without incident.

Can anyone help?

Public Function GetPage(ByVal bClearPayload As Boolean) As String
Dim objResponse As WebResponse
Try
Dim objRequest As HttpWebRequest
Dim objRequestStrea m, objReceiveStrea m As Stream
Dim objReader As StreamReader
Dim bytPayload() As Byte
Dim szURL As String

'now it's time to encode the payload (payload is set by properties
Dim szPayloadForm As String = GetPayloadFromN ameValue(m_objF orm)
Dim szPayloadQuery As String = GetPayloadFromN ameValue(m_objW ebClient.QueryS tring)

szURL = m_szURL 'module level set by property

If Not szPayloadQuery Is Nothing AndAlso szPayloadQuery. Length > 0 Then
szURL = String.Format(" {0}?{1}", szURL, EncodePayload(s zPayloadQuery))
End If

objRequest = DirectCast(WebR equest.Create(s zURL), HttpWebRequest)

If Not szPayloadForm Is Nothing AndAlso szPayloadForm.L ength > 0 Then
objRequest.Meth od = "POST"
objRequest.Cont entType = "applicatio n/x-www-form-urlencoded"
bytPayload = System.Text.Enc oding.UTF8.GetB ytes(EncodePayl oad(szPayloadFo rm))
objRequest.Cont entLength = bytPayload.Leng th
objRequestStrea m = objRequest.GetR equestStream()
objRequestStrea m.Write(bytPayl oad, 0, bytPayload.Leng th)
objRequestStrea m.Close()
Else
objRequest.Meth od = "GET"
End If

With objRequest
.CookieContaine r = New CookieContainer
End With

objResponse = objRequest.GetR esponse() 'EXCEPTION RAISES HERE
objReceiveStrea m = objResponse.Get ResponseStream( )
objReader = New StreamReader(ob jReceiveStream, Encoding.ASCII)

Dim chrRead(256) As Char
Dim nCount As Integer = objReader.Read( chrRead, 0, 256)
Dim sbResponse As New System.Text.Str ingBuilder

Do Until nCount = 0
Dim str As String = New String(chrRead, 0, nCount)
sbResponse.Appe nd(str)
nCount = objReader.Read( chrRead, 0, 256)
Loop

Return sbResponse.ToSt ring

Catch Ex As Exception
Throw Ex
Finally
If Not objResponse Is Nothing Then
objResponse.Clo se()
End If

If bClearPayload Then
m_objForm.Clear ()
m_objWebClient. QueryString.Cle ar()
End If
End Try
End Function
Nov 20 '05 #1
1 2162
Cor
Hi Anthony,
This doesn't happen on my development machine (code works perfectly) but on the client's machine, I get an error reported that "too many automatic >redirections ". I've tried setting the maximum to a large number without prevail.


I did not look at your code (because it works on your computer why not on the client, than it can not be something by code where my thoughts).

My first thoughts where, has the client maybe some other connection open and is he using http1.1.
As far as I know is it only possible to have two http1.1 connections open in one time.
Cor

Nov 20 '05 #2

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

Similar topics

8
11210
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to update 3 row(s)." Is there a way to prevent the message from popping up?
11
3326
by: MLH | last post by:
If this is what MySQL is set to... SELECT DISTINCTROW qryVehiclesNowners5.SerialNum, qryVehiclesNowners5.VDescr, qryVehiclesNowners5.Owner, qryVehiclesNowners5.VehicleJobID , tblVehicleJobs.Reclaimed, tblVehicleJobs.VSaleID, tblVehicleJobs.ENF262Written FROM qryVehiclesNowners5 INNER JOIN tblVehicleJobs ON qryVehiclesNowners5.VehicleJobID =...
1
11252
by: Philip Bondi | last post by:
Hello to all SQL Server junkies who work with non-English characters: For people running scripts from the command line using ANSI files with special characters, it is very important to use isql and disable "Automatic ANSI to OEM conversion": - This only affects isql from the command line, and no gui applications -...
7
2563
by: jnikle | last post by:
I have a database in A2003 format that's giving me this error, but it's not the same situation I've been reading about on here. In my development copy, I have imported copies of the backend's tables, and everything works fine. I can also compile the database like this, and it works fine. However, as soon as I get rid of these copies and...
4
5079
by: Philip Nelson | last post by:
Folks, I've got a database and tablespaces "managed by automatic storage". I've deleted a lot of data from some tables. I've then reorged them. But the tablespaces don't appear to shrink in size (they just have lots of free space). How can I get DB2 to give the space back ?
0
5581
by: minapatel | last post by:
I have the following procedure CREATE OR REPLACE procedure FOL_PURGE_CASES as /* type "SET SERVEROUTPUT ON" in sqlplus to debug !! */ cursor all_cases is cursor all_cases is select c.id00_warehouse, c.id00_case_nbr, c.id00_status_flag, c.id00_dlm from phpick00 a, chcart00 b, idcase00 c
0
1302
by: sherkhan | last post by:
Hello Everyone. I have come across this article (http://dast.nlanr.net/Projects/ Autobuf_v1.0/autotcp.html) called "Automatic TCP window tuning". After my first newbie file transfer I wrote and found that it was just extremely slow over net, compared to http or ftp. I have been thinking of reasons. After reading the article I modified the...
3
2983
by: DrVitoti | last post by:
On that program the compiler says "parse error" on line 8, 10, 12 and 21, it also says "too many arguments" on lines 10, 12 and finally it says "at this port in" on lines 13, 14, 20 . How could I solve it? I know it may be noob mistakes, but this is my first program ;-) main(){ int Operando_1; int Operando_2; int Suma; int...
30
3799
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at the end of the app for example: class test { public: int x;
0
7496
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7452
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5354
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3485
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.