# Class TOKHTTPInternetAccess

Description
Hierarchy
Fields
Methods
Properties

## Unit

okhttpinternetaccess

## Declaration

`type TOKHTTPInternetAccess = class(TInternetAccess)`

## Description

Internet access class using the Java OkHttp library.

Set defaultInternetAccessClass to `TOKHTTPInternetAccess` if you want to use this class on Android.
Additionally bbjniutils.jvmref must be set to the Java VM reference.
Use the global onBuildCallback to customize the OkHttpClient.
Note: OkHttp is not installed on Android, you need to include it in your Java dependencies. You cannot use it on a main thread in an app, because Android does not allow internet access from the main thread. If you create a thread in Pascal, you likely cannot create the OkHttp client there, since the thread class loader cannot access dependencies only Android classes. Hence you need to create it on the main thread, or keep a class loader reference in bbjniutils.jCustomClassLoader
Not yet supported: proxies, user/password authentication

## Hierarchy

- TObject
- TInternetAccess
- TOKHTTPInternetAccess

## Overview

### Methods

| `constructor create(); override;`
| `constructor create(const internetConfig: TInternetConfig); override;`
| `destructor destroy; override;`
| `function internalHandle: TObject; override;`

## Description

### Methods

| `constructor create(); override;`

| `constructor create(const internetConfig: TInternetConfig); override;`

| `destructor destroy; override;`

| `function internalHandle: TObject; override;`

Generated by PasDoc 0.16.0.