Renamed JsonResource code to statusCode

This commit is contained in:
Erik C. Thauvin 2024-12-26 11:16:24 -08:00
parent f0ccff6529
commit 97e0479ffb
Signed by: erik
GPG key ID: 776702A6A2DA330E
7 changed files with 38 additions and 27 deletions

View file

@ -154,13 +154,16 @@ A generic `apiCall()` function is available to access other [JokeAPI endpoints](
For example to retrieve the French [language code](https://v2.jokeapi.dev/#langcode-endpoint):
```kotlin
val lang = JokeApi.apiCall(
val response = JokeApi.apiCall(
endPoint = "langcode",
path = "french",
params = mapOf(Parameter.FORMAT to Format.YAML.value)
)
println(lang.data)
if (response.statusCode == 200) {
println(response.data)
}
```
```yaml
error: false
code: "fr"