-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathCurlInterface.php
58 lines (52 loc) · 1.3 KB
/
CurlInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\FunctionalTestingFramework\Util\Protocol;
/**
* Curl protocol interface.
*/
interface CurlInterface
{
/**
* HTTP request methods.
*/
const GET = 'GET';
const PUT = 'PUT';
const POST = 'POST';
const DELETE = 'DELETE';
/**
* Add additional option to cURL.
*
* @param integer $option
* @param integer|string|boolean|array $value
* @return $this
*/
public function addOption($option, $value);
/**
* Send request to the remote server.
*
* @param string $url
* @param array|string $body
* @param string $method
* @param array $headers
* @return void
*/
public function write($url, $body = [], $method = CurlInterface::POST, $headers = []);
/**
* Read response from server.
*
* @param string $successRegex
* @param string $returnRegex
* @param string|null $returnIndex
* @return string|array
*/
public function read($successRegex = null, $returnRegex = null, $returnIndex = null);
/**
* Close the connection to the server.
*
* @return void
*/
public function close();
}