1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage HTTP
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 use Joomla\Registry\Registry;
13
14 /**
15 * HTTP transport class interface.
16 *
17 * @since 11.3
18 */
19 interface JHttpTransport
20 {
21 /**
22 * Constructor.
23 *
24 * @param Registry $options Client options object.
25 *
26 * @since 11.3
27 */
28 public function __construct(Registry $options);
29
30 /**
31 * Send a request to the server and return a JHttpResponse object with the response.
32 *
33 * @param string $method The HTTP method for sending the request.
34 * @param JUri $uri The URI to the resource to request.
35 * @param mixed $data Either an associative array or a string to be sent with the request.
36 * @param array $headers An array of request headers to send with the request.
37 * @param integer $timeout Read timeout in seconds.
38 * @param string $userAgent The optional user agent string to send with the request.
39 *
40 * @return JHttpResponse
41 *
42 * @since 11.3
43 */
44 public function request($method, JUri $uri, $data = null, array $headers = null, $timeout = null, $userAgent = null);
45
46 /**
47 * Method to check if HTTP transport is available for use
48 *
49 * @return boolean True if available else false
50 *
51 * @since 12.1
52 */
53 public static function isSupported();
54 }
55