forked from parse-community/parse-php-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParseHttpable.php
More file actions
94 lines (82 loc) · 1.97 KB
/
Copy pathParseHttpable.php
File metadata and controls
94 lines (82 loc) · 1.97 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* Class ParseHttpable | Parse/HttpClients/ParseHttpable.php
*/
namespace Parse\HttpClients;
/**
* Class ParseHttpable - Interface for an HTTPable client
*
* @author Ben Friedman <friedman.benjamin@gmail.com>
* @package Parse\HttpClients
*/
interface ParseHttpable
{
/**
* Adds a header to this request
*
* @param string $key Header name
* @param string $value Header value
*/
public function addRequestHeader($key, $value);
/**
* Gets headers in the response
*
* @return array
*/
public function getResponseHeaders();
/**
* Returns the status code of the response
*
* @return int
*/
public function getResponseStatusCode();
/**
* Returns the content type of the response
*
* @return null|string
*/
public function getResponseContentType();
/**
* Sets the connection timeout
*
* @param int $timeout Timeout to set
*/
public function setConnectionTimeout($timeout);
/**
* Sets the request timeout
*
* @param int $timeout Sets the timeout for the request
*/
public function setTimeout($timeout);
/**
* Sets the CA file to validate requests with
*
* @param string $caFile CA file to set
*/
public function setCAFile($caFile);
/**
* Gets the error code
*
* @return int
*/
public function getErrorCode();
/**
* Gets the error message
*
* @return string
*/
public function getErrorMessage();
/**
* Sets up our client before we make a request
*/
public function setup() : void;
/**
* Sends an HTTP request
*
* @param string $url Url to send this request to
* @param string $method Method to send this request via
* @param array $data Data to send in this request
* @return string
*/
public function send($url, $method = 'GET', $data = array());
}