Android Question convert php code to okhttp

Rasoull

Member
Hello
How can I write the following php code with okhttp?
PHP:
function get_file_curl($url,$proxy_host,$proxy_port,$loginpassw)
    {
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
     curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
     curl_setopt($ch, CURLOPT_PROXY, $proxy_host);
     curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);
     curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
     $data = curl_exec($ch);
     curl_close($ch);
     return $data;
    }
    var_dump(get_file_curl("instagram.com", "http://gw.ntnt.io", "5959", "rasoull-res-ANY:Aa@1234"));
 
Top