Skip to content

Commit

Permalink
Add a note on optional values
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Dec 28, 2021
1 parent 7911a25 commit 4cc975d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ print(encoder.queryItems)
// [URLQueryItem(name: "id", value: "5")]
```

By default, optional values are not encoded.

```swift
var id: Int?
let encoder = URLQueryEncoder()
encoder.encode(id, forKey: "id")

print(encoder.queryItems)
// []
```

### Encoding Arrays

```swift
Expand Down

0 comments on commit 4cc975d

Please sign in to comment.