So I have created a controller class to get the content of an HTTP post. The method is as follows:
' POST api/<controller>
Public Sub PostValue(<FromBody()> ByVal value As String)
'code logic go here...
End Sub
When I code to read the 'value' parameter within the function above, for the post content, it's always an empty string. As for testing, I have used curl to do a post, and it looks as follows:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:52043/api/test --data json="{'parameter': [{'name':'Name', 'value':'123'}]}"
What have I done wrong here? Please help. Thanks!