1 | <?php |
||
2 | |||
3 | namespace seregazhuk\PinterestBot\Api\Contracts; |
||
4 | |||
5 | interface HttpClient |
||
6 | { |
||
7 | const COOKIE_PREFIX = 'pinterest_bot_cookie'; |
||
8 | |||
9 | /** |
||
10 | * Executes curl request. |
||
11 | * |
||
12 | * @param string $url |
||
13 | * @param string $postString |
||
14 | * @param array $headers |
||
15 | * @return string |
||
16 | */ |
||
17 | public function execute($url, $postString = '', array $headers = []); |
||
18 | |||
19 | /** |
||
20 | * Set custom Curl options to override default |
||
21 | * |
||
22 | * @param array $options |
||
23 | * @return HttpClient |
||
24 | */ |
||
25 | public function setOptions(array $options); |
||
26 | |||
27 | /** |
||
28 | * @param $name |
||
29 | * @return mixed |
||
30 | */ |
||
31 | public function cookie($name); |
||
32 | |||
33 | /** |
||
34 | * @return array |
||
35 | */ |
||
36 | public function cookies(); |
||
37 | |||
38 | /** |
||
39 | * Load cookies for specified username |
||
40 | * |
||
41 | * @param string $username |
||
42 | * @return HttpClient |
||
43 | */ |
||
44 | public function loadCookies($username = ''); |
||
45 | |||
46 | /** |
||
47 | * Returns current url after all redirects |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getCurrentUrl(); |
||
51 | |||
52 | /** |
||
53 | * Set directory to store all cookie files. |
||
54 | * @param string $path |
||
55 | * @return HttpClient |
||
56 | */ |
||
57 | public function setCookiesPath($path); |
||
58 | |||
59 | /** |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getCookiesPath(); |
||
63 | |||
64 | /** |
||
65 | * @return HttpClient |
||
66 | */ |
||
67 | public function removeCookies(); |
||
68 | |||
69 | /** |
||
70 | * @param string $host '192.168.1.1' |
||
71 | * @param string $port '12345' |
||
72 | * @param string $auth Authentication string: 'username:password' |
||
73 | * @param string $type HTTP|SOCKS |
||
74 | * @return HttpClient |
||
75 | */ |
||
76 | public function useProxy($host, $port, $auth = null, $type = null); |
||
77 | |||
78 | /** |
||
79 | * @param string $host |
||
80 | * @param string $port |
||
81 | * @param null $auth |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
82 | * @return HttpClient |
||
83 | */ |
||
84 | public function useSocksProxy($host, $port, $auth = null); |
||
85 | |||
86 | /** |
||
87 | * @return HttpClient |
||
88 | */ |
||
89 | public function dontUseProxy(); |
||
90 | |||
91 | /** |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function usesProxy(); |
||
95 | } |
||
96 |