Not seeing the error msg for http 400 response

I checked every line and it matches my request in Postman, but I get a http 400 - bad request response in Can some please help? below is an outline of the code:

Dim jsonPayload As String = JsonConvert.SerializeObject(payloadObject)
jsonPayload = "{ ““profile””: " + jsonPayload + “}”

Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)

request.Method = “POST”
request.Headers.Add(“Authorization”, "SSWS " + apiToken)
request.ContentType = “application/json”
request.Accept = “application/json”

Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes(jsonPayload)
request.ContentLength = byteArray.Length
Using writer As Stream = request.GetRequestStream()
writer.Write(byteArray, 0, byteArray.Length)
End Using

Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)

I get an error on the above line - {“The remote server returned an error: (400) Bad Request.”}


What API call are you making, the URL is not supplied.
Can you supply the actual http request that is being made by VB.

Thank You,

Thanks for responding Erik,

       Dim payloadObject As New With {
             .firstName = firstName,
             .lastName = lastName,
             .email = email,
             .password = password,
             .login = userName,
             .mobilePhone = "555-415-1337"

If you need any additional information, please let me know

hey @Jay_k if you’re using macos, please double check you’re not using smart quotes - How to Turn off Smart Quotes - Apple Community