VB.net sending HTTP POST request using SOCKETS

二次信任 提交于 2019-12-06 11:07:52

If you can send a GET request using Sockets then you can certainly send a POST request.

You have to format it properly though. You can check the RFC for the whole HTTP specs.

Sample of a POST:

Dim request = "POST /nationwide/mip/choice-hotels-international-462092189/send_email?lid=161004592 HTTP/1.1" & Environment.Newline &
                          "Host: 208.93.105.105" & Environment.Newline &
                          "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36" & Environment.Newline &
                          "Connection: keep-alive" & Environment.Newline &
                          "Content-Type: application/x-www-form-urlencoded" & Environment.Newline &
                          "Content-Length: 22" & Environment.Newline & Environment.Newline &
              "this%20is%20the%20data"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!