Skip to content

Commit

Permalink
Update README.md for Custom Configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles authored Oct 13, 2023
1 parent 530a2c2 commit 851228d
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
```
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)
```
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 851228d

Please sign in to comment.