Skip to content

Commit fc57881

Browse files
committed
fix: Added info about handling responses with empty bodies
1 parent 8773c53 commit fc57881

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ It is generic on two types: a response (`S`), and an error (`E`). The response t
121121
println(usersResponse() ?: "No users were found")
122122
```
123123

124+
- Some API responses convey information through headers only, and contain empty bodies. Such endpoints must be used with `Unit` as their success type.
125+
126+
```kotlin
127+
@GET("/empty-body-endpoint")
128+
suspend fun getEmptyBodyResponse(): NetworkResponse<Unit, ErrorType>
129+
```
130+
124131
---
125132

126133
## Benefits

0 commit comments

Comments
 (0)