Ask a Question related to ASP.NET General, Design and Development.
-
dgiard #1
System.Net.HttpWebRequest with HTTPS
I am using the System.Net.HttpWebRequest object to POST data to an HTTPS web
page.
Other than prefixing the URL with "HTTPS://", do I need to do anything in my
code to indicate that this is SSL?
Here is my code:
// Create Web Request
string url = "https://something.net/something.dll";
HttpWebRequest oHttp =
(HttpWebRequest) WebRequest.Create(url);
// Post form variables
string params = "x_Version=" + version
+ "&x_DelimData=" + delimData
+ "&x_Login=" + login
+ "&x_Password=" + password
+ "&x_Amount=" + amount
+ "&x_Card_Num=" + cardNumber
+ "&x_Exp_Date=" + expirationDate
+ "&x_Type=" + type;
oHttp.Method="POST";
byte [] postBuffer =
System.Text.Encoding.GetEncoding(1252).GetBytes(pa rams);
oHttp.ContentLength = postBuffer.Length;
Stream postData = oHttp.GetRequestStream();
postData.Write(postBuffer,0,postBuffer.Length);
postData.Close();
// Get results
HttpWebResponse myResponse = (HttpWebResponse) oHttp.GetResponse();
Encoding enc = System.Text.Encoding.GetEncoding(1252);
StreamReader loResponseStream =
new StreamReader(myResponse.GetResponseStream(), enc);
string retHtml = loResponseStream.ReadToEnd();
myResponse.Close();
loResponseStream.Close();
messages = retHtml;
dgiard Guest
-
#38631 [Bgs]: fopen('https://...') or curl with https gives Segmentation fault
ID: 38631 Updated by: darkelder@php.net Reported By: roberto dot berto at gmail dot com Status: Bogus Bug... -
httpwebrequest please help clarify
I am posting an xml document using httpwebrequest post method using a x509certificate, my question is this, is this secure if I am posting to an... -
Problem using HttpWebRequest/HttpWebResponse with HTTPS
Did you ever solve this problem? If so, please can you let me know how as I am trying to do something similar. richard.beacroft@warnerbros.com ... -
HttpWebRequest and 401
Hello All Here is what I am attempting to do: I have a NTLM protected site. There are some users who are not part of the domain (visitors) get... -
HTTPWebRequest
Well, here's the scenario: In your base app, the user's credentials are verified. If the rest of those apps "hang under" the base app, then you... -
Joerg Jooss #2
Re: System.Net.HttpWebRequest with HTTPS
"dgiard" spoke:
Check out if the framework's default certificate policy (URL below)> I am using the System.Net.HttpWebRequest object to POST data to an
> HTTPS web page.
>
> Other than prefixing the URL with "HTTPS://", do I need to do
> anything in my code to indicate that this is SSL?
works for you. If not, you need to implement your own. But that should
be it.
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-[/url]
us/cpref/html/frlrfSystemNetServicePointManagerClassCertificateP olicyTop
ic.asp
Cheers,
--
Joerg Jooss
[email]joerg.jooss@gmx.net[/email]
Joerg Jooss Guest
-
dgiard #3
Re: System.Net.HttpWebRequest with HTTPS
Thanks, Joerg.
"Joerg Jooss" <joerg.jooss@gmx.net> wrote in message
news:OfG1RIqTDHA.3132@tk2msftngp13.phx.gbl...> "dgiard" spoke:
>>> > I am using the System.Net.HttpWebRequest object to POST data to an
> > HTTPS web page.
> >
> > Other than prefixing the URL with "HTTPS://", do I need to do
> > anything in my code to indicate that this is SSL?
> Check out if the framework's default certificate policy (URL below)
> works for you. If not, you need to implement your own. But that should
> be it.
>
> [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-[/url]
> us/cpref/html/frlrfSystemNetServicePointManagerClassCertificateP olicyTop
> ic.asp
>
> Cheers,
> --
> Joerg Jooss
> [email]joerg.jooss@gmx.net[/email]
dgiard Guest



Reply With Quote

