VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,737 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a VB.net app that is trying to send a post request to get a token. However, I get the error above. Below is a snipit of the code in question.
Dim client = New RestClient(stTokenURL)
Dim request = New RestRequest(Method.Post)
Dim result As String
Dim stJson As String = "{"
request.AddHeader("Accept", "application/json")
request.AddHeader("Content-Type", "application/json")
stJson = stJson + Chr(34) + "email" + Chr(34) + ":" + Chr(34) + stuserName + Chr(34) + ","
stJson = stJson + Chr(34) + "password" + Chr(34) + ":" + Chr(34) + stpassword + Chr(34)
stJson = stJson + "}"
request.AddStringBody(stJson, DataFormat.Json)
'request.AddParameter("application/json", stJson, ParameterType.RequestBody)
Dim stresponse As RestResponse = client.Execute(request)
Dim stStatusCode As String = stresponse.StatusCode.ToString