天天看點

vb.net WebAPI傳輸

Dim encoding As New UTF8Encoding()
            Dim request As HttpWebRequest = WebRequest.Create(“你的位址”)

            request.Method = "POST"
            request.Accept = "text/html, application/xhtml+xml, */*"
            request.ContentType = "application/json"

            Dim buffer As Byte() = encoding.GetBytes(body)
            request.ContentLength = buffer.Length
            request.GetRequestStream().Write(buffer, 0, buffer.Length)
            Dim response As HttpWebResponse = request.GetResponse()

            Using sr As New StreamReader(response.GetResponseStream(), encoding.UTF8)
                Return sr.ReadToEnd()
            End Using

           

vb.net教程

java基礎

python基礎教程

繼續閱讀