TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nilanka Dharmadasa
NA
3k
0
How to post a request to an 'https' url ????
Oct 27 2006 2:33 AM
Hi,
I want to post an XMLHTTPRequest to a server for the screen scrapping
purpose. but it always throws an exception .
{"The download of the specified resource has failed.\r\n" }
[System.Runtime.InteropServices
.COMException]:
{System.Runtime.InteropServices
.COMException}
System.Object: {System.Runtime.InteropServices
.COMException}
_className: null
_COMPlusExceptionCode: -532459699
_exceptionMethod: <undefined value>
_exceptionMethodString: null
_helpURL: null
_HResult: -2146697208
This is the code I have written.
MSXML.XMLHTTPRequestClass lobjRequest = new XMLHTTPRequestClass();
string lstrNull = null;
object lobjNull =lstrNull;
string lstrBody="";
lobjRequest.open("POST","
https://xxxxxxxxxxx
, false, lobjNull,
lobjNull);
lobjRequest.setRequestHeader("Content-Type",
"application/x-www-form
-urlencoded");
lobjRequest.setRequestHeader("Referer","
http://xxxxxxxx
");
string lstrRequest="xxxxxxxxxxxxxxxxx
";
lobjRequest.send(lstrRequest);
lstrBody = lobjRequest.responseText;
The same code works fine when the request is posted to an http url.
Is there any solution for this? I tried to use WinHttp. But it also
asks for a client certificate.
hope someone will help me.
Reply
Answers (
0
)
username password login authorization in C-sharp
Need a C# Tutorial