Rick,
While your document is much better than Microsoft's, it still does not
answer any of my outstanding questions, of which I will summarize:
1) Need to gzip post data for transport- having the server gunzip it before
persisting data. (ie; transfer-encoding)
Problems here: setting transfer-encoding: says I have to set SendChunked =
true. When I do this while adding the header, the .SendChunked property goes
back to false (even though HttpWebRequest is shuttled around as (ref). I
have to explicitly remember it and set it again before calling
.GetResponse() otherwise I get the same exception as trying to add the
header.
HTTP 1.1 spec says "chunked" must follow other tokens when using
"transfer-encoding", so trying to do "Transfer-Encoding: gzip;chunked" I get
another exception saying I have to set the Chunked property. Only I didn't
find a chunked property (I am setting SendChunked=true.
As a test I've just saved the raw form data to a .txt file- using a
freeware package, I've gzip'd that to form_data.gz, in my post routine I
read the contents of this .gz file into a byte [] and write that to the
HttpWebRequest.GetRequestStream() stream.
At last I get a response from the server- but upon checking for the posted
data- it's blank!
2) How can I determine at runtime if a URL I'm going to requires a client
cert. The only thing I am able to get is the 403 Forbidden? And along these
lines- say I send a request and it comes back with 407 Proxy Authentication,
what do I need to do exactly to be able to re-use the HttpWebRequest
instance, setting credentials of course, to resubmit the original request?
3) I've implemented a class that inherits the ICertificatePolicy interface.
I then set ServicePointManager.CertificatePolicy = this. In my
CheckValidationResult(), I log server cert info and return true. Now say for
example, the CN name on the server cert does not match the site name, my
CheckValidationResult() function is called. After returning true, if I go to
the same site- my CheckValidationResult() is not called again. I assume
because I returned true, and it has cached that information.
My question is can I change this behavior so it will always call my
CheckValidationResult() on each new request, if there is a cert problem?
I've checked ServicePointManger and ServicePoint but do not see any method
that would clear, flush, reset, etc. this information.
Regards,
Erin.
Rick Strahl said:
http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm
This article talks about a lot of non-obvious things that aren't covered in
the docs.
+++ Rick ---
--
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp