# Having trouble coding POST into Visual Basic Visual Studio 2019

**URL:** <https://community.postman.com/t/having-trouble-coding-post-into-visual-basic-visual-studio-2019/33359>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [March 10, 2022, 12:07am UTC](https://community.postman.com/t/having-trouble-coding-post-into-visual-basic-visual-studio-2019/33359 "2022-03-10T00:07:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter6320](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Peter6320](https://community.postman.com/u/Peter6320)\
**Post date:** [March 10, 2022, 12:07am UTC](https://community.postman.com/t/having-trouble-coding-post-into-visual-basic-visual-studio-2019/33359/1 "2022-03-10T00:07:43Z")

</div>

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:

1. There are no parms
2. There is nothing in Authentication EXCEPT pulldown type is “Inherit auth from parent”
3. There is one Header Content-Type “x-www-form-urlencoded”
4. 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.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 12:55pm UTC](https://community.postman.com/t/having-trouble-coding-post-into-visual-basic-visual-studio-2019/33359/2 "2024-12-12T12:55:15Z")

</div>

Closed on December 12, 2024, 12:55pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
