- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I would like to write an application in Kotlin that uses the Spotify API. To start with I would like to just understand what is going on and wrote the following code:
val client = HttpClient(CIO)
suspend fun main(args: Array<String>) {
val otvet:String=client.post("https://accounts.spotify.com/api/token"){
headers{"Content-Type: application/x-www-form-urlencoded"}
setBody("grant_type=client_credentials&client_id=000&client_secret=000")
}.body()
println(otvet)
}
(I removed the key and secret key)
But instead of what was described here: https://developer.spotify.com/documentation/web-api/tutorials/getting-started
I got an HTML page that opens if I open https://accounts.spotify.com/api/token directly in the browser. How to fix it?
Solved! Go to Solution.
Labels:
- Labels:
-
Question
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page