Hello:
 
    I am just bugging around with OpenSRS API with ASP.NET, I tried to execute the following code that  [EMAIL PROTECTED] gave me a while back.  It returns the following error:  The remote server returned an error: (405) Method Not Allowed.
 
Here is the code that I am using: 
 
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
 

<%
 
Dim result
                Dim payload as string
                Dim req As WebRequest
            Dim RequestStream As Stream
            Dim ReceiveStream As Stream
            Dim sr As StreamReader
            req = WebRequest.Create("http://resellers-test.opensrs.net")
            req.Method = "POST"
            req.ContentType = "application/x-www-form-urlencoded"
                payload ="username=visorx15"
                payload &="&password=testx11"
                payload &="&action=""
            Dim utf8 As New UTF8Encoding
            Dim arBytes() As Byte = utf8.GetBytes(payload)
            req.ContentLength = arBytes.Length
            RequestStream = req.GetRequestStream()
            RequestStream.Write(arBytes, 0, arBytes.Length)
            RequestStream.Close()
            result = req.GetResponse()
            ReceiveStream = result.GetResponseStream()
            sr = New StreamReader(ReceiveStream, System.Text.Encoding.GetEncoding("utf-8"))
            Dim resp As String = sr.ReadToEnd
            response.write(resp)
 
response.write(result)
%>
 
Any ideas?
 
Thanks
-Hayk

Reply via email to