Dim xml As New System.Xml.XmlDocument()

Dim root As XmlElement
root = xml.CreateElement("xs:sequence")
xml.AppendChild(root)

Dim username As XmlElement
username = xml.CreateElement("USER_NAME")
username.InnerText = "xxx"
root.AppendChild(username)

Dim password As XmlElement
password = xml.CreateElement("Password")
password.InnerText = "Abc.123"
root.AppendChild(password)
Dim Veri As String




Console.WriteLine(root.InnerXml)
Dim url = "xxx"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.ContentType = "application/xml"
req.Headers.Add("Custom: API_Method")
Dim vOut() As Byte = System.Text.Encoding.UTF8.GetBytes(xml.InnerXml.Length)
req.ContentLength = vOut.Length

Dim newStream As Stream = req.GetRequestStream()
xml.Save(newStream)

Dim response As WebResponse = req.GetResponse()

Console.Write(response.ToString())


Arkadaşlar Elimde Boyle Bir Kod Var

System.Net.ProtocolViolationException: 'Akışa yazılacak baytların boyutu, belirtilen Content-Length bayt boyutunu aşıyor.'

Boyle Bir Hata Alıyorum Ne Yapmam Gerekiyor