You have some pretty confused code there.
The set_ContentType method is a method of the page object, used only on the
server side.
In addition, it is a method used internally by .NET and is not intended to
be used from your code.
Considering the fact that you are creating an HttpWebRequest object, the
set_ContentType method doesn't apply.
My guess is that you posted this snippet after it failed to compile...
correct?
A good example of the code you need can be found here
http://msdn.microsoft.com/library/en...engthtopic.asp
And, yes, posting to an HTTPS URL will have the effect of encrypting the
data in-stream. You do not need to use any encryption APIs.
Try it for yourself. Sniff the port. (If you don't have a sniffer, you may
want to try Ethereal or one of the other sniffing utilities that uses
WinPCap to sniff your ports.)
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mike Cronin via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:a1******** *************** *******@DotNetM onster.com...
If a 128-bit encrypted client sends an HTTPS POST request to a server that
handles 128-bit encryption, does the client need to do anything more than
what follows...
String url = "https://securesite.com? user=xxx&passwo rd=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();
Under the circumstances mentioned, will this simple request produce a 128-
bit encrypted POST?
Is there no need to use System.Security .Cryptography.X 509Certificates ?
I just need to be clear on the level of encryption.
Any assistance is most appreciated!
Mike Cronin
--
Message posted via http://www.dotnetmonster.com