private function getClientInternal($type = null) {
		if ($type != null) {
			if (isset($this->clients[$type])) {
				return $this->clients[$type];
			} else {
				throw new \Exception("No http client with type '$type' found.");
			}
		} else {
			foreach ($this->clients as $client) {
				if ($client->isSupported()) {
					return $client;
				}
			}
			throw new \Exception('No supported http client found.');
		}
	}