Dim encoding As New UTF8Encoding()
Dim request As HttpWebRequest = WebRequest.Create(“http://www.baidu.com”)
request.Method = "POST"
'request.Accept = "text/html, application/xhtml+xml, */*"
'这是干啥的
request.ContentType = "application/json"
Dim Buffer As Byte() = encoding.GetBytes("serialNumber")
Dim response As HttpWebResponse = request.GetResponse()
MsgBox(response.ToString)
End Sub
这里面没有body语句,我不知道怎么写,在body里我想写“serialNumber”:1
还有取得返回值时用的语句也不是很明白
我曾尝试使用postman里的代码,但是没有vb.net语句,用c里的到了VB里也报错
希望得到结果,写出body语句,然后将内容反馈到textbox里
已完成。
方法1: