Skip to content

Commit 1dc9a1c

Browse files
authored
Fixed the java samples in the Example.md file (#807)
1 parent 643d9dc commit 1dc9a1c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

EXAMPLES.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,12 +1288,9 @@ account.networkingClient = netClient
12881288
<summary>Using Java</summary>
12891289

12901290
```java
1291-
DefaultClient netClient = new DefaultClient(
1292-
connectTimeout = 30,
1293-
readTimeout = 30
1294-
);
1291+
DefaultClient netClient = new DefaultClient(30, 30);
12951292
Auth0 account = Auth0.getInstance("client id", "domain");
1296-
account.networkingClient = netClient;
1293+
account.setNetworkingClient(netClient);
12971294
```
12981295
</details>
12991296

@@ -1312,11 +1309,13 @@ account.networkingClient = netClient
13121309
<summary>Using Java</summary>
13131310

13141311
```java
1312+
import java.util.HashMap;
1313+
13151314
DefaultClient netClient = new DefaultClient(
1316-
enableLogging = true
1315+
10, 10, new HashMap<>() ,true
13171316
);
13181317
Auth0 account = Auth0.getInstance("client id", "domain");
1319-
account.networkingClient = netClient;
1318+
account.setNetworkingClient(netClient);
13201319
```
13211320
</details>
13221321

@@ -1339,10 +1338,10 @@ Map<String, String> defaultHeaders = new HashMap<>();
13391338
defaultHeaders.put("{HEADER-NAME}", "{HEADER-VALUE}");
13401339

13411340
DefaultClient netClient = new DefaultClient(
1342-
defaultHeaders = defaultHeaders
1341+
10,10 , defaultHeaders
13431342
);
13441343
Auth0 account = Auth0.getInstance("client id", "domain");
1345-
account.networkingClient = netClient;
1344+
account.setNetworkingClient(netClient);
13461345
```
13471346
</details>
13481347

@@ -1376,7 +1375,7 @@ class CustomNetClient extends NetworkingClient {
13761375
ServerResponse response = // ...
13771376

13781377
// Return a ServerResponse from the received response data
1379-
return ServerResponse(responseCode, responseBody, responseHeaders)
1378+
return new ServerResponse(responseCode, responseBody, responseHeaders);
13801379
}
13811380
};
13821381

auth0/src/main/java/com/auth0/android/request/DefaultClient.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class DefaultClient @VisibleForTesting(otherwise = VisibleForTesting.PRIV
3737
* @param defaultHeaders any headers that should be sent on all requests. If a specific request specifies a header with the same key as any header in the default headers, the header specified on the request will take precedence. Default is an empty map.
3838
* @param enableLogging whether HTTP request and response info should be logged. This should only be set to `true` for debugging purposes in non-production environments, as sensitive information is included in the logs. Defaults to `false`.
3939
*/
40+
@JvmOverloads
4041
public constructor(
4142
connectTimeout: Int = DEFAULT_TIMEOUT_SECONDS,
4243
readTimeout: Int = DEFAULT_TIMEOUT_SECONDS,

0 commit comments

Comments
 (0)