Skip to content

Commit

Permalink
Updated basic example in quickstart section
Browse files Browse the repository at this point in the history
  • Loading branch information
rybalkinsd authored May 24, 2020
1 parent 86275dd commit 031d8b3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ Kotlin DSL http client

## Quick start
```kotlin
// Use String or URL extensions send simple request
val response = "https://my-host.com/users?admin=true".httpGet()
// use integration with your favorite serialization library
val usersData = users.toJson()

val pushNotifications: List<Deferred<Response>> = usersData.map {
// Parse response with your favorite library
val users = response.toJson()

// Use sync or async methods to send your requests
// Configure method params, headers, cookies and body in a concise way
val notifications: List<Deferred<Response>> = users.forEach { user ->
httpPostAsync {
url("https://my-host.com/friends/push")

param {
"userId" to it[id]
"userId" to user[id]
"eventType" to NewFriend
}

Expand Down

0 comments on commit 031d8b3

Please sign in to comment.