File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ class ProxyRequestGet implements ProxyRequestInterface
6969 */
7070 private $ portProxy ;
7171
72+ /**
73+ * json|csv|''
74+ * @var string
75+ */
76+ private $ format ;
77+
7278 /**
7379 * @param string $token
7480 * @param string $server
@@ -90,7 +96,8 @@ public function sendRequest()
9096 'not_country_code_raw ' => $ this ->notCountryCodeRaw ,
9197 'http ' => $ this ->http ,
9298 'socks ' => $ this ->socks ,
93- 'port_proxy ' => $ this ->portProxy
99+ 'port_proxy ' => $ this ->portProxy ,
100+ 'format ' => $ this ->format
94101 ]);
95102
96103 $ urlFinal = "{$ this ->server }/api/proxyget/ {$ this ->token }? {$ query }" ;
@@ -138,7 +145,6 @@ public function setNotCountryCodeRaw($notCountryCodeRaw)
138145 }
139146
140147 /**
141- *
142148 *
143149 * @param mixed $http 1 or 0
144150 * @return ProxyRequestGet
@@ -177,5 +183,15 @@ public function setPortProxy($portProxy)
177183 return $ this ;
178184 }
179185
186+ /**
187+ * @param string $format
188+ * @return $this
189+ */
190+ public function setFormat ($ format )
191+ {
192+ $ this ->format = $ format ;
193+ return $ this ;
194+ }
195+
180196
181197}
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- curl http://public.proxyrequest.ru/api/proxyget/free
3+ # Default, additional field 'success' in response indicates result of operation
4+ curl http://public.proxyrequest.ru/api/proxyget/free
5+
6+ # proxies only, json
7+ curl http://public.proxyrequest.ru/api/proxyget/free? format=json
8+
9+ # proxies only, in csv
10+ curl http://public.proxyrequest.ru/api/proxyget/free? format=csv
11+
You can’t perform that action at this time.
0 commit comments