|
98 | 98 | TODO
|
99 | 99 |
|
100 | 100 | ## Kotlin (okhttp3)
|
| 101 | +Here are the detailed instructions for running the generated API Dash code in Kotlin (using okhttp3) for macOS, Windows, and Linux: |
| 102 | + |
| 103 | +### 1. Install Kotlin: |
| 104 | +To run Kotlin code, you need to install Kotlin first. You can install Kotlin from the official Kotlin website: |
| 105 | + |
| 106 | +- Go to [Kotlin Installation Guide](https://kotlinlang.org/docs/getting-started.html#install-kotlin) for detailed steps. |
| 107 | +- Remember: `Kotlin is included in each IntelliJ IDEA and Android Studio release. Download and install one of these IDEs to start using Kotlin`. |
| 108 | + |
| 109 | +Once Kotlin is installed, proceed with adding `okhttp` and running the generated code. |
| 110 | + |
| 111 | +### 2. Add `okhttp` library: |
| 112 | +To use `okhttp3` in your Kotlin project, you need to include it as a dependency. If you're using **Gradle**, follow these steps: |
| 113 | + |
| 114 | +- Open the `build.gradle` file in your project. |
| 115 | +- Add the following dependency in the `dependencies` section: |
| 116 | + |
| 117 | +```gradle |
| 118 | +implementation("com.squareup.okhttp3:okhttp:4.12.0") |
| 119 | +``` |
| 120 | + |
| 121 | +- Sync your project to apply the dependency. |
| 122 | + |
| 123 | +### 3. Execute the generated code: |
| 124 | +After setting up Kotlin and `okhttp3`, follow these steps to run the generated code: |
| 125 | + |
| 126 | +1. **Open your IDE** ✍️ (like Android Studio). |
| 127 | +2. **Create a new Kotlin file** 📝 (or use an existing one). |
| 128 | +3. **Copy the generated code** 📋 from API Dash. |
| 129 | +4. **Paste the code** into the Kotlin file 🔄. |
| 130 | +5. **Run the Kotlin file** by clicking the "Run" button in your IDE or by using the command line. |
| 131 | + |
| 132 | +#### If you're running from the command line: |
| 133 | +1. **Navigate to the project directory** using the terminal or command prompt. |
| 134 | +2. **Compile and run the Kotlin file** with these commands: |
| 135 | + |
| 136 | +```bash |
| 137 | +kotlinc api_test.kt -include-runtime -d api_test.jar |
| 138 | +java -jar api_test.jar |
| 139 | +``` |
101 | 140 |
|
102 |
| -TODO |
103 | 141 |
|
104 | 142 | ## PHP (curl)
|
105 | 143 |
|
|
0 commit comments