Ive got a case where I can run a successful Postman execution but I cannot get it programmed into Visual basic. I have done many before so I am baffled.
What is unusual about this case in the working Postman is:
- There are no parms
- There is nothing in Authentication EXCEPT pulldown type is “Inherit auth from parent”
- There is one Header Content-Type “x-www-form-urlencoded”
- There are 4 variables in Body incluing username, password, and 2 other fields.
in VB I handled 3 with request.ContentType = " application/x-www-form-urlencoded". SHould I have used application-type/x-www-form-urlencoded ??
item 2 I ignored because looking at other codes non showed this field as coded. Is there some other wy to overtly specify this? I tried header.add but it didnt anything so i ignore it.
item 4 was handled with:
payload = “username=username&password=12345&grant_type=password&client_id=999”
then Dim byteArray As Byte() = Encoding.UTF8.GetBytes(payload)
then request.ContentLength = byteArray.Length
then next statement: Dim dataStream As Stream = request.GetRequestStream() craps out
Message I get is: The request was aborted: Could not create SSL/TLS secure channel.
URL is same as Postman, Postman works from same machine as VB Visual Studio program.
Spent all day trying to figure out what isnt working, permuted everything I can think of
Would love ideas or insights into something I am not doing properly.
Thx in advance.