I want to create a post method to read data from body sent by Authorize.Net webhook using VB.Net and i'm new in VB.Net can someone please assist how to read data from body in a Post type method.
To send/receive HTTP requests/responses, typically you would use the HttpClient class (documentation). Specifically in this case you would:
Here is a function (untested) that should get you going in the right direction:
Imports System.Net
Imports System.Net.Http
Imports System.Threading.Tasks
Imports Newtonsoft.Json
Imports System.Text
'...
Private Async Function SendPost(url As String, data As Object) As Task(Of String)
Dim body = String.Empty
Using client = New HttpClient
Dim content As New StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json")
Dim response = Await client.PostAsync(url, content)
If (response.StatusCode = HttpStatusCode.OK) Then
body = Await response.Content.ReadAsStringAsync()
End If
End Using
Return body
End Function