First off, I am just learning myself. However, in my research for using
HttpWebRequest most examples, whether in VB or C#, explicitly cast the
result of WebRequest.Create into a HttpWebRequest object
So, in VB, something like:
Dim myReq As HttpWebRequest = _
CType(WebRequest.Create("http://www.contoso.com/codesnippets/next.asp"),
HttpWebRequest)
or C#
HttpWebRequest myReq = (HttpWebRequest)
WebRequest.Create("http://www.contoso.com/codesnippets/next.asp");
Is it not possible that the fact that code works in some versions and not
others could be the result of different versions of the compiler allowing
sloppy type assignment? So, the compiler for which the POST data is
disappearing is strictly enforcing type and the others are not?
The pointer assignment in all cases is legal because in inheritance, a
pointer to a parent object can always be assigned to a child object, but not
vice versa (because the child can contain fields/members the parent does
not). So, the object assignment itself is not causing any errors, but the
non-working version's compiler is only too happy to make the initial object
assignment and then ignore attempts to modify HttpWebRequest properties on
an object the compiler considers to be a pointer to a WebRequest object?
Anyway, that's my shot in the dark, and it is at least easy to test.
your relevant code:
Dim myReq As HttpWebRequest = _
> > WebRequest.Create("http://www.contoso.com/codesnippets/next.asp")
> Update: When I compile the code below on my develpment machine (WinXP) and
> run it, it doesn't add the POST data. I take the same compiled EXE file and
[quoted text clipped - 49 lines]
> > End Sub
> > End Module
Harold Paine - 07 Feb 2005 23:06 GMT
Thanks Bill. It was worth a try, but still the same results.
All three computers I've tried it on have the same CLR version, and since
it's the same compiled EXE I'm running, I hope it would be the same.
I'm semi conviced my GAC holds the key to my problem, so I'm going to start
looking there.
Thanks,
-Travis
> First off, I am just learning myself. However, in my research for using
> HttpWebRequest most examples, whether in VB or C#, explicitly cast the
[quoted text clipped - 99 lines]
>> > End Sub
>> > End Module
NativeSun - 08 Feb 2005 01:19 GMT
OK, I need help.
The files in my GACs are the same. On two computers when I run the EXE the
POST data gets added to the stream. On my new develpment computer, the POST
data doesn't get added.
Any where else I can look?
Thanks,
Travis
NativeSun - 08 Feb 2005 17:25 GMT
I'm starting to think it has something to do with the underlying ServicePoint
that .NET is accessing. I say that because, running the same EXE on two
different computers results in two different request packets. One with the
POST data, and one without. The header on the packet without the POST data
also has a Connection: Keep-Alive.
Spark any ideas in anyone?
Thanks,
Travis