Skip to content

Commit

Permalink
Update README.md for Custom Configurations (#879)
Browse files Browse the repository at this point in the history
* Update README.md for Custom Configurations

* Update README.md

* Update README.md
  • Loading branch information
iNoles authored Oct 17, 2023
1 parent 530a2c2 commit 9018cb0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ runBlocking {

```

## Custom Configuration
JVM uses [OkHttpClient](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/) configurations
```kotlin
val fuel = FuelBuilder().config(OKHttpClient()).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
```

Apple uses [NSURLSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration)
```kotlin
val fuel = FuelBuilder().config(NSURLSessionConfiguration.defaultSessionConfiguration).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
```

Please note it will throw Exceptions. Make sure you catch it on the production apps.

Fuel requires Java 8 byte code.
Expand Down

0 comments on commit 9018cb0

Please sign in to comment.