Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27391

[RESOLVED] httpwebrequest & https

$
0
0
Hi,

Now, I try to access to this page https://secure.mysite.com/myfile.php
With a browser no problem, I got in return "Missing loging" as content & the status 403.
All ok

But I'm unable to access to this page with my code.

Code:


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Net.WebRequest.DefaultWebProxy = Nothing
        Net.ServicePointManager.UseNagleAlgorithm = False
        Net.ServicePointManager.Expect100Continue = False
        Net.ServicePointManager.DefaultConnectionLimit = 48
       

        ' Create a request for the URL.
        Dim request As WebRequest = _
          WebRequest.Create("https://secure.mysite.com/myfile.php")
       
        ' Get the response.
        Dim response As WebResponse = request.GetResponse() <= HERE ERROR (System.Net.WebException)

        ' Display the status.
        Debug.Print(CType(response, HttpWebResponse).StatusDescription)

        ' Get the stream containing content returned by the server.
        Dim dataStream As Stream = response.GetResponseStream()

        ' Open the stream using a StreamReader for easy access.
        Dim reader As New StreamReader(dataStream)

        ' Read the content.
        Dim responseFromServer As String = reader.ReadToEnd()

        ' Display the content.
        Debug.Print(responseFromServer)

        ' Clean up the streams and the response.
        reader.Close()
        response.Close()

End Sub

I got an Exception = at this line "Dim response As WebResponse = request.GetResponse()"
I never got the content return ("Missing loging")


What's happen ? with http query it's work, with https it doen't work

Please help me if you have an idea !!

Isa

Viewing all articles
Browse latest Browse all 27391

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>