Foxtable(狐表)用户栏目专家坐堂 → HTTPRequest怎么接收XML格式的数据


  共有6424人关注过本帖平板打印复制链接

主题:HTTPRequest怎么接收XML格式的数据

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/16 10:25:00 [只看该作者]

mark UserProcessHosts

 

启动代码这样写

 

HttpServer.Prefixes.Add("http://127.0.0.1:8888/")
HttpServer.Start()
HttpServer.UserProcessHosts.add("127.0.0.1")

 

httprequest代码这样写

 

Select Case e.Path
    Case "test.htm", ""
        Dim body As New System.IO.StreamReader(e.Request.InputStream, encoding.utf8)
        Dim value As String = body.ReadToEnd
        msgbox(value)
End Select

 

测试发送数据这样写

 

Dim hc As New HttpClient("http://127.0.0.1:8888/test.htm")
hc.Content = "<?xml version=""1.0"" encoding=""utf-8"" ?><abc>123</abc>"
hc.ContentType = "application/x-www-form-urlencoded"
Dim ret As String = hc.GetData()


 回到顶部
总数 45 1 2 3 4 5 下一页