|
43 | 43 |
|
44 | 44 | ## C# (HttpClient)
|
45 | 45 |
|
46 |
| -TODO |
| 46 | +Here are the detailed instructions for running the generated API Dash code in C# (using `HttpClient`) for macOS, Windows, and Linux: |
| 47 | + |
| 48 | + |
| 49 | +### 1. Setting Up the C# Development Environment |
| 50 | +#### macOS and Windows: |
| 51 | +1. **Install .NET SDK:** |
| 52 | + - Visit the [official .NET download page](https://dotnet.microsoft.com/download). |
| 53 | + - Download and install the latest .NET SDK for macOS. |
| 54 | +2. **Verify Installation:** |
| 55 | + - Open the terminal and run the following command to verify the installation: |
| 56 | + ```bash |
| 57 | + dotnet --version |
| 58 | + ``` |
| 59 | + |
| 60 | + |
| 61 | +#### Linux: |
| 62 | +1. **Install .NET SDK:** |
| 63 | + - Run the following commands based on your distribution: |
| 64 | + - For Ubuntu/Debian-based systems: |
| 65 | + ```bash |
| 66 | + sudo apt update |
| 67 | + sudo apt install dotnet-sdk-7.0 |
| 68 | + ``` |
| 69 | + - For Fedora/CentOS-based systems: |
| 70 | + ```bash |
| 71 | + sudo dnf install dotnet-sdk-7.0 |
| 72 | + ``` |
| 73 | +2. **Verify Installation:** |
| 74 | + - Open the terminal and run the following command to verify the installation: |
| 75 | + ```bash |
| 76 | + dotnet --version |
| 77 | + ``` |
| 78 | + |
| 79 | +### 2. Preparing HttpClient |
| 80 | + |
| 81 | +#### In Visual Studio: |
| 82 | +1. **Create a New Project:** |
| 83 | + - Open Visual Studio and select **Create a new project**. |
| 84 | + - Choose the **Console Application (.NET Core)** template and create the project. |
| 85 | + |
| 86 | +2. **Check `System.Net.Http` Namespace:** |
| 87 | + - `HttpClient` is included by default. No additional installation is required. |
| 88 | + |
| 89 | +#### Using the CLI: |
| 90 | +1. **Create a Project:** |
| 91 | + ```bash |
| 92 | + dotnet new console -n HttpClientExample |
| 93 | + cd HttpClientExample |
| 94 | + ``` |
| 95 | + |
| 96 | +2. **Install the Package (if necessary):** |
| 97 | + ```bash |
| 98 | + dotnet add package System.Net.Http |
| 99 | + ``` |
| 100 | + |
| 101 | +### 3. Execute the generated code: |
| 102 | +Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute the generated code: |
| 103 | + |
| 104 | +1. **Open a IDE/text editor** ✍️ (Visual Studio, VS Code or any other text editor). |
| 105 | +2. **Copy the generated code** 📋 from API Dash. |
| 106 | +3. **Paste the code** into your project. ex) prgoram.cs |
| 107 | + |
| 108 | + |
| 109 | +### 4. Running the Project |
| 110 | + |
| 111 | +#### In Visual Studio: |
| 112 | +1. Click the **Start Debugging (F5)** button from the top menu to run the project. |
| 113 | +2. The output window will display the API response. |
| 114 | + |
| 115 | +#### Using the CLI: |
| 116 | +1. Open the terminal at the project root directory and run the following command: |
| 117 | + ```bash |
| 118 | + dotnet run |
| 119 | + ``` |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
47 | 124 |
|
48 | 125 | ## C# (RestSharp)
|
49 | 126 |
|
|
0 commit comments