Skip to content

aswanabidin/kotlin-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kotlin Scripts 🚀

Before you running several command in your terminal, please ensure you have installed the Kotlin compiler. For more details please read kotlin documentation here Kotlin command-line compiler. I want to highlight for how to install the Kotlin compiler in your local machine, please following steps below :

📝 Install Kotlin on UNIX-based systems such as OS X, Linux, Cygwin, FreeBSD, and Solaris is SDKMAN!! To install the Kotlin compiler via SDKMAN!, run the following command in a terminal :

$sdk install kotlin

📝 Alternatively, on OS X you can install the compiler via Homebrew from the command line :

$brew update
$brew install kotlin

📝 If you use Snap on Ubuntu 16.0.4 or later, you can install the compiler from the command line :

$sudo snap install --classic kotlin

Testing API Endpoints using Terminal Android Studio without Postman

  1. If you have kotlin scripts file inside other directory. Please ensure navigate up one directory level, run the following command in a terminal for example : cd scripts scripts is directory name.

  2. Execute kotlin scripts file, run the following command in a terminal : kotlin api-endpoint-test.main.kts

  3. Input host url type (e.g.: github, spotify). For this case we provide github and spotify endpoints as host url type. Run the following command in a terminal :

    Screen Shot 2021-07-04 at 14 26 29
  4. Input endpoint that you will testing. For example in this case, we input events as endpoint github apps.

    Screen Shot 2021-07-04 at 14 28 45
  5. Input OAuth Token (if using spotify API), this section you can skip for input token if you choosing github API.

    Screen Shot 2021-07-04 at 14 33 57
  6. After input oAuth token section is done. Script will show information to waiting response from API. Then, we will see response success or failure.

    Screen Shot 2021-07-04 at 14 37 24