# Can snippet C#-HTTPClient call in Console Application

**URL:** <https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395>\
**Category:** Help Hub\
**Tags:** snippet\
**Created:** [April 26, 2024, 6:55pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395 "2024-04-26T18:55:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zjz-postman](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@zjz-postman](https://community.postman.com/u/zjz-postman)\
**Post date:** [April 26, 2024, 6:55pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/1 "2024-04-26T18:55:17Z")

</div>

Postman can convert an API request into a code snippet, such as C#-HTTPClient. We can use the generated code snippet in Web application to make calls to an API. But I’m wondering if this can be made from a C# Console Application? We need to make files upload and download to/from TitanFile site automatically. Some methods which are created from the code snippet in the console application will be called by task scheduler.

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [April 29, 2024, 12:04pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/2 "2024-04-29T12:04:42Z")

</div>

Hi @zjz-postman. Welcome to the Postman Community!

I do not write C#, so my reply is very limited. However, I believe the code generated by Postman should be runnable anywhere C# can be ran. Could you clarify on why you think it won’t work in a C# console? Have you tried running it there?

---

<div class="post-metadata">

**Author:** ![zjz-postman](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@zjz-postman](https://community.postman.com/u/zjz-postman)\
**Post date:** [April 29, 2024, 1:19pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/3 "2024-04-29T13:19:03Z")

</div>

Thanks Gbadebo. I created a C# console application with serval download methods. No file has been downloaded in my local folder after running those methods.

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [April 30, 2024, 12:28pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/4 "2024-04-30T12:28:10Z")

</div>

I think you might have to take a look at the generated code properly. THe generated code gives you a good headstart to making a specific API request in a chosen language, but can at times not work right out of the box due to different reasons.

---

<div class="post-metadata">

**Author:** ![zjz-postman](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@zjz-postman](https://community.postman.com/u/zjz-postman)\
**Post date:** [May 2, 2024, 1:46pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/5 "2024-05-02T13:46:02Z")

</div>

Code snippets works fine with our C# Console Application where we use the postman API snippets on Titan files download and upload.

---

<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:02pm UTC](https://community.postman.com/t/can-snippet-c-httpclient-call-in-console-application/60395/7 "2024-12-12T12:02:07Z")

</div>

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

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