Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Sh committed Apr 24, 2024
1 parent 4dd0a83 commit ee1938a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/ProxyRequestGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class ProxyRequestGet implements ProxyRequestInterface
*/
private $portProxy;

/**
* json|csv|''
* @var string
*/
private $format;

/**
* @param string $token
* @param string $server
Expand All @@ -90,7 +96,8 @@ public function sendRequest()
'not_country_code_raw' => $this->notCountryCodeRaw,
'http' => $this->http,
'socks' => $this->socks,
'port_proxy' => $this->portProxy
'port_proxy' => $this->portProxy,
'format' => $this->format
]);

$urlFinal = "{$this->server}/api/proxyget/{$this->token}?{$query}";
Expand Down Expand Up @@ -138,7 +145,6 @@ public function setNotCountryCodeRaw($notCountryCodeRaw)
}

/**
*
*
* @param mixed $http 1 or 0
* @return ProxyRequestGet
Expand Down Expand Up @@ -177,5 +183,15 @@ public function setPortProxy($portProxy)
return $this;
}

/**
* @param string $format
* @return $this
*/
public function setFormat($format)
{
$this->format = $format;
return $this;
}


}
10 changes: 9 additions & 1 deletion tests/TestCulrProxyGet.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/bash

curl http://public.proxyrequest.ru/api/proxyget/free
# Default, additional field 'success' in response indicates result of operation
curl http://public.proxyrequest.ru/api/proxyget/free

# proxies only, json
curl http://public.proxyrequest.ru/api/proxyget/free?format=json

# proxies only, in csv
curl http://public.proxyrequest.ru/api/proxyget/free?format=csv

0 comments on commit ee1938a

Please sign in to comment.