0
Dim request As WebRequest = WebRequest.Create("http://www.example.com/a.aspx ")
request.Method = "POST"

Dim postData = Encoding.UTF8.GetBytes("example")
request.ContentLength = postData.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(postData, 0, postData.Length)
dataStream.Close()

Examples like above can be found everywhere, but how about the other side - how to retrieve and process the request data (i.e."example")?

Ursidae
  • 87
  • 9
  • So you want to create an `ASP.NET web api POST method written in VB`? Honestly, not finding many vb.net examples myself, but try googling those search terms and see what you can figure out. – Ben Jun 18 '19 at 01:16
  • C# examples are welcome too. I have been googling a lot but everything I have found are only the 'sender side' of request, like the code sample I quote above. – Ursidae Jun 18 '19 at 02:54
  • You should find plenty of C# examples (even the blank 'new' asp.net api project creates a simple post method). Make sure to search for `asp.net web api POST`. Here's a stack overflow question/answer with some examples: https://stackoverflow.com/questions/20226169/how-to-pass-json-post-data-to-web-api-method-as-an-object – Ben Jun 18 '19 at 03:11

0 Answers0