100+ results for 'php curl_setopt'
Not the results you expected?
impermium.php (https://github.com/PopSugar/Impermium-PHP.git) PHP · 449 lines
1 <?php
3 /**
4 * Impermium-PHP
5 *
6 * A simple PHP wrapper for Impermium
30 if (!function_exists('curl_init')) {
31 throw new Exception('Impermium-PHP needs the CURL PHP extension.');
32 }
34 if (!function_exists('json_decode')) {
35 throw new Exception('Impermium-PHP needs the JSON PHP extension.');
36 }
Curl.php (https://bitbucket.org/acidel/buykoala.git) PHP · 238 lines
1 <?php
2 /**
3 * Magento
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
22 * @package Varien_Http
23 * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
48 protected function _applyConfig()
49 {
50 //curl_setopt();
51 if (isset($this->_config['timeout'])) {
52 curl_setopt($this->_getResource(), CURLOPT_TIMEOUT, $this->_config['timeout']);
PayPalHttpConnection.php (https://gitlab.com/CORP-RESELLER/PayPal-PHP-SDK) PHP · 193 lines
1 <?php
3 namespace PayPal\Core;
10 * Requires the PHP curl module to be enabled.
11 * See for full requirements the PHP manual: http://php.net/curl
12 */
13 class PayPalHttpConnection
81 unset($options[CURLOPT_HTTPHEADER]);
82 }
83 curl_setopt_array($ch, $options);
84 curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl());
85 curl_setopt($ch, CURLOPT_HEADER, true);
86 curl_setopt($ch, CURLINFO_HEADER_OUT, true);
87 curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders());
90 switch ($this->httpConfig->getMethod()) {
91 case 'POST':
92 curl_setopt($ch, CURLOPT_POST, true);
93 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
definitions.php (https://gitlab.com/scsistemas/superprime) PHP · 262 lines
1 <?php
2 //$urlWS = 'http://qa.superprimeweb.com/admin/index.php?';
3 $urlWS = 'http://localhost:8080/superprime/admin/index.php?';
4 $rutaFotos = '../images/fotos/';
5 //$rutaFotos = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . '/backend/images/fotos/';
37 $hashUrl = $urlWS . 'service=generalservices&metodo=actualizarClaveValor';
38 $curl = curl_init($hashUrl);
39 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
40 curl_setopt($curl, CURLOPT_POST, true);
41 curl_setopt($curl, CURLOPT_POSTFIELDS, $hashParam);
42 $responseHash = curl_exec($curl);
43 curl_close($curl);
73 $service_url = 'https://api.mercadolibre.com/oauth/token';
74 $curl = curl_init($service_url);
75 curl_setopt($curl, CURLOPT_POST, true);
76 curl_setopt($curl, CURLOPT_POSTFIELDS, $tokenParam);
mtgox.php (https://github.com/MobiusL/simplecoin.git) PHP · 357 lines
1 <?php
2 /**
3 * Mt Gox Trade API Client
12 * @license licence.txt ISC license
13 * @see https://www.mtgox.com/support/tradeAPI
14 * @see https://github.com/ukd1/Mt-Gox-Trade-API-PHP-Client
15 */
23 * @license licence.txt ISC license
24 * @see https://www.mtgox.com/support/tradeAPI
25 * @see https://github.com/ukd1/Mt-Gox-Trade-API-PHP-Client
26 */
27 class mtgox_order extends mtgox_base
72 public function cancel ()
73 {
74 return is_array($this->_post('cancelOrder.php', array('oid' => $this->data['oid'], 'type' => $this->data['type'])));
75 }
76 }
etherpad-lite-client.php (https://github.com/efault/elggpad-lite.git) PHP · 260 lines
1 <?php
2 class EtherpadLiteClient {
29 );
30 $url = $this->baseUrl."/".self::API_VERSION."/".$function."?".http_build_query($query);
31 // not all PHP installs have access to curl
32 if (function_exists('curl_init')){
33 $c = curl_init($url);
34 curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
35 curl_setopt($c, CURLOPT_TIMEOUT, 20);
events_controller.php (https://github.com/ajaykalia/groupalbum.git) PHP · 310 lines
1 <?php
2 /**
3 * file: app/controllers/events_controller.php
50 function gallery($slug = null) {
51 require $_SERVER['DOCUMENT_ROOT'].'files/config.php';
53 $session = $facebook->getSession();
140 $ch = curl_init();
141 $my_album = 'https://graph.facebook.com/'.$fb_album_id.'/photos?access_token='.$fb_session_token;
142 curl_setopt($ch, CURLOPT_URL, $my_album);
143 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
227 require $_SERVER['DOCUMENT_ROOT'].'files/config.php';
229 $session = $facebook->getSession();
ElggRewriteTester.php (https://github.com/wangaiying/elgg4ysu.git) PHP · 195 lines
1 <?php
3 /**
76 // try curl if installed
77 $ch = curl_init();
78 curl_setopt($ch, CURLOPT_URL, $url);
79 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
80 curl_setopt($ch, CURLOPT_TIMEOUT, 10);
81 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
115 } else {
116 // check if this is an old Elgg htaccess
117 if (strpos($data, 'RewriteRule ^rewrite.php$ install.php') == FALSE) {
118 $this->htaccessIssue = 'old_elgg_htaccess';
119 return FALSE;
Service.php (https://github.com/boxbilling/extensions.git) PHP · 222 lines
1 <?php
3 class Box_Mod_Servicegps_Service
158 class GpsApi
159 {
160 protected $_api_url = 'http://apigps.antanas.eu/api.php';
162 public function __construct($options)
188 $ch = curl_init();
189 curl_setopt($ch, CURLOPT_URL, $this->_api_url);
190 curl_setopt($ch, CURLOPT_POST, true);
191 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
192 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
EpiOAuth.php (https://github.com/Knight-Mozilla/spurious.git) PHP · 233 lines
1 <?php
2 session_start();
3 class EpiOAuth
75 $_h[] = substr($oauth, 0, -1);
77 curl_setopt($ch, CURLOPT_HTTPHEADER, $_h);
78 }
122 $ch = curl_init($url);
123 $this->addOAuthHeaders($ch, $url, $params['oauth']);
124 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
125 $resp = $this->curl->addCurl($ch);
132 $ch = curl_init($url);
133 $this->addOAuthHeaders($ch, $url, $params['oauth']);
134 curl_setopt($ch, CURLOPT_POST, 1);
135 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params['request']));
auspost.php (https://github.com/MariusRugan/OpenCart-Secured.git) PHP · 144 lines
1 <?php
2 class ModelShippingAuspost extends Model {
3 public function getQuote($address) {
33 $ch = curl_init();
35 curl_setopt($ch, CURLOPT_URL, 'http://drc.edeliver.com.au/ratecalc.asp?pickup_postcode=' . $this->config->get('auspost_postcode') . '&destination_postcode=' . $address['postcode'] . '&height=70&width=70&length=70&country=AU&service_type=standard&quantity=1&weight=' . $weight);
36 curl_setopt($ch, CURLOPT_HEADER, 0);
37 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
39 $get_standard = curl_exec($ch);
83 $ch = curl_init();
85 curl_setopt($ch, CURLOPT_URL, 'http://drc.edeliver.com.au/ratecalc.asp?pickup_postcode=' . $this->config->get('auspost_postcode') . '&destination_postcode=' . $address['postcode'] . '&height=70&width=70&length=70&country=AU&service_type=express&quantity=1&weight=' . $weight);
86 curl_setopt($ch, CURLOPT_HEADER, 0);
Single.php (https://gitlab.com/flyhope/Hiblog) PHP · 276 lines
OAuth2Client.php (https://gitlab.com/code26/selah) PHP · 229 lines
1 <?php
2 /**
3 * HybridAuth
33 public $curl_ssl_verifyhost = false;
34 public $curl_header = array();
35 public $curl_useragent = "OAuth/2 Simple PHP Client v0.1; HybridAuth http://hybridauth.sourceforge.net/";
36 public $curl_authenticate_method = "POST";
37 public $curl_proxy = null;
172 $ch = curl_init();
174 curl_setopt($ch, CURLOPT_URL , $url );
175 curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1 );
176 curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out );
177 curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent );
get_operations.php (https://github.com/axshavan/nitrofuran.git) PHP · 160 lines
1 <? header("Content-Type: text/html; charset=utf-8") ?>
2 <form action="get_operations.php" method="get">
3 <input type="text" name="login" id="login" value="<?= $_GET['login'] ? htmlspecialchars($_GET['login']) : 'admin' ?>"> <label for="login">login</label><br />
4 <input type="text" name="password" id="password" value="<?= $_GET['password'] ? htmlspecialchars($_GET['password']) : '' ?>"> <label for="password">password</label><br />
5 <input type="submit" value="Test">
6 </form>
7 <?php
9 if($_GET['login'])
15 $curl = curl_init($_SERVER['SERVER_NAME'].'/kassa/api/');
16 curl_setopt($curl, CURLOPT_POSTFIELDS, 'login='.$_GET['login'].'&password='.$_GET['password'].'&method=getaccounts');
17 ob_start();
18 curl_exec($curl);
31 $curl = curl_init($_SERVER['SERVER_NAME'].'/kassa/api/');
32 curl_setopt($curl, CURLOPT_POSTFIELDS, 'login='.$_GET['login'].'&password='.$_GET['password'].'&method=getcurrencies');
33 ob_start();
34 curl_exec($curl);
ezsoapclient.php (https://github.com/itag/ezpublish.git) PHP · 270 lines
1 <?php
2 /**
3 * File containing the eZSOAPClient class.
11 /*!
12 \class eZSOAPClient ezsoapclient.php
13 \ingroup eZSOAP
14 \brief eZSOAPClient is a class which can be used as a SOAP client
165 if ( $this->Timeout != 0 )
166 {
167 curl_setopt( $ch, CURLOPT_TIMEOUT, $this->TimeOut );
168 }
169 $payload = $request->payload();
183 $HTTPCall .= "\r\n" . $payload;
185 curl_setopt( $ch, CURLOPT_URL, $URL );
186 curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
step_one.php (https://bitbucket.org/santafear/converted.git) PHP · 102 lines
1 <?php
3 //exemple php /var/www/webroot/converter/step_one.php /home/chroot/user1/home/user1/2 1 2
4 //exemple php /usr/local/converter/step_one.php /home/katanyou/2 1 2
5 //exemple php /var/converted/step_one.php /home/katanyou/2 1 2 (in 61.47.40.194)
6 //https://studio.ving.tv/api/wowza/getftppath
7 //https://studio.ving.tv/api/wowza/getftppathads/
31 // $ch = curl_init('https://studio.ving.tv/api/wowza/createvideo/partner_id/'. $partner_id .'/tv_channel_id/'. $channel_id .'/name/'. basename($file).'/ftp_name/'.$ftp_name);
33 curl_setopt($ch, CURLOPT_HEADER, 0);
34 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
35 curl_setopt($ch, CURLOPT_VERBOSE, 0);
36 $json = curl_exec($ch);
37 print curl_error($ch);
realex_remote.php (https://gitlab.com/reclamare/mao) PHP · 260 lines
1 <?php
2 class ModelPaymentRealexRemote extends Model {
3 public function install() {
63 $ch = curl_init();
64 curl_setopt($ch, CURLOPT_URL, "https://epage.payandshop.com/epage-remote.cgi");
65 curl_setopt($ch, CURLOPT_POST, 1);
66 curl_setopt($ch, CURLOPT_USERAGENT, "OpenCart " . VERSION);
67 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
68 curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
69 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
127 $ch = curl_init();
128 curl_setopt($ch, CURLOPT_URL, "https://epage.payandshop.com/epage-remote.cgi");
129 curl_setopt($ch, CURLOPT_POST, 1);
HttpRequest.php (git://github.com/phpmyadmin/phpmyadmin.git) PHP · 312 lines
11 use function curl_getinfo;
12 use function curl_init;
13 use function curl_setopt;
14 use function file_get_contents;
15 use function function_exists;
175 }
177 $curlStatus &= (int) curl_setopt($curlHandle, CURLOPT_USERAGENT, 'phpMyAdmin');
179 if ($method !== 'GET') {
187 if ($method === 'POST') {
188 $curlStatus &= (int) curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $content);
189 }
Curl.php (https://github.com/hit-moodle/moodle-assignment-type_github.git) PHP · 130 lines
AndroidMarket.class.php (https://gitlab.com/billyprice1/app-download.org) PHP · 130 lines
1 <?php
2 require_once(__DIR__ . '/../proto/download.php');
3 require_once(__DIR__ . '/../proto/error.php');
5 class DownloadFailedException extends Exception {}
48 $curl = curl_init();
50 curl_setopt($curl, CURLOPT_URL, 'https://android.clients.google.com/fdfe/purchase');
51 curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($query));
52 curl_setopt($curl, CURLOPT_USERAGENT,
53 'Android-Finsky/4.6.17 (api=3,versionCode=80260017)');
54 curl_setopt($curl, CURLOPT_HTTPHEADER, array(
57 ));
59 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
60 curl_setopt($curl, CURLOPT_BINARYTRANSFER, TRUE);
Curl.php (https://github.com/herrsebi/search.git) PHP · 149 lines
1 <?php
2 namespace Doctrine\Search\Http\Adapter;
21 {
22 if (!extension_loaded('curl')) {
23 throw new AdapterInitializationException('The cURL PHP extension has to be installed and loaded to use this Doctrine\Http\Client.');
24 }
25 }
35 $this->curlConnection = curl_init();
36 if ($port != 80) {
37 curl_setopt($this->curlConnection, CURLOPT_PORT, intval($port));
38 }
40 curl_setopt($this->curlConnection, CURLOPT_CONNECTTIMEOUT, $this->config['timeout']);
41 curl_setopt($this->curlConnection, CURLOPT_MAXREDIRS, $this->config['maxredirects']);
class.restClient.php (https://bitbucket.org/ferOnti/processmaker.git) PHP · 349 lines
1 <?php
3 /**
23 {
24 $this->curl = curl_init();
25 curl_setopt( $this->curl, CURLOPT_RETURNTRANSFER, true );
26 curl_setopt( $this->curl, CURLOPT_AUTOREFERER, true ); // This make sure will follow redirects
27 curl_setopt( $this->curl, CURLOPT_FOLLOWLOCATION, true ); // This too
28 curl_setopt( $this->curl, CURLOPT_HEADER, true ); // THis verbose option for extracting the headers
37 {
38 if ($this->method === "POST") {
39 curl_setopt( $this->curl, CURLOPT_POST, true );
40 curl_setopt( $this->curl, CURLOPT_POSTFIELDS, $this->params );
42 //die;
43 } elseif ($this->method == "GET") {
44 curl_setopt( $this->curl, CURLOPT_HTTPGET, true );
45 $this->treatURL();
46 } elseif ($this->method === "PUT") {
curl.php (https://github.com/xiaoshenge/snsLogin.git) PHP · 256 lines
4 * A basic CURL wrapper
5 *
6 * See the README for documentation/examples or http://php.net/curl for more information about the libcurl extension for PHP
7 *
8 * @package curl
73 *
74 * Sets the $cookie_file to "curl_cookie.txt" in the current directory
75 * Also sets the $user_agent to $_SERVER['HTTP_USER_AGENT'] if it exists, 'Curl/PHP '.PHP_VERSION.' (http://github.com/shuber/curl)' otherwise
76 **/
77 function __construct() {
78 $this->cookie_file = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_cookie.txt';
79 $this->user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'Curl/PHP '.PHP_VERSION.' (http://github.com/shuber/curl)';
80 }
cost.php (https://github.com/zsalwen/Service-Office.git) PHP · 158 lines
1 <?
2 include("cost.linemaker.php");
3 mysql_connect();
4 mysql_select_db('core');
27 $curl = curl_init();
28 if(strstr($referer,"://")){
29 curl_setopt ($curl, CURLOPT_REFERER, $referer);
30 }
31 curl_setopt ($curl, CURLOPT_URL, $url);
32 curl_setopt ($curl, CURLOPT_TIMEOUT, $timeout);
33 curl_setopt ($curl, CURLOPT_USERAGENT, sprintf("Mozilla/%d.0",rand(4,5)));
34 curl_setopt ($curl, CURLOPT_HEADER, (int)$header);
35 curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
function.curl-copy-handle.html (https://bitbucket.org/thncr/manuals.git) HTML · 79 lines
10 <div class="next" style="text-align: right; float: right;"><a href="function.curl-errno.html">curl_errno</a></div>
11 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
12 <div class="home"><a href="index.html">PHP Manual</a></div>
13 </div><hr /><div id="function.curl-copy-handle" class="refentry">
14 <div class="refnamediv">
15 <h1 class="refname">curl_copy_handle</h1>
16 <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">curl_copy_handle</span> — <span class="dc-title">复制一个cURL句柄和它的所有选项</span></p>
18 </div>
64 <div class="phpcode"><code><span style="color: #000000">
65 <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// 创建一个新的cURL资源<br /></span><span style="color: #0000BB">$ch </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// 设置URL和相应的选项<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">, </span><span style="color: #DD0000">'http://www.example.com/'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_HEADER</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 复制句柄<br /></span><span style="color: #0000BB">$ch2 </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_copy_handle</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 抓取URL (http://www.example.com/) 并把它传递给浏览器<br /></span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch2</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 关闭cURL资源,并且释放系统资源<br /></span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
66 </span>
67 </code></div>
76 <div class="next" style="text-align: right; float: right;"><a href="function.curl-errno.html">curl_errno</a></div>
77 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
78 <div class="home"><a href="index.html">PHP Manual</a></div>
79 </div></body></html>
Client.php (https://gitlab.com/fabiorf/moip-1) PHP · 133 lines
1 <?php namespace SOSTheBlack\Moip;
3 use App;
9 * @author Paulo Cesar
10 * @version 0.0.2
11 * @license <a href="http://www.opensource.org/licenses/bsd-license.php">BSD License</a>
12 */
13 class Client {
31 }
32 $curl = curl_init();
33 curl_setopt($curl, CURLOPT_URL, $url);
34 curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
35 curl_setopt($curl, CURLOPT_USERPWD, $credentials);
36 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
TumblrBlog.php (https://github.com/bdalziel/tumblwrapper.git) PHP · 150 lines
1 <?php
3 require('TumblrPost.php');
48 public function getUrl () {
49 return "blog.php";
50 }
127 protected function executeQuery ($query, $timeout = 10) {
128 $ch = curl_init();
129 curl_setopt($ch, CURLOPT_URL, $query);
130 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
131 curl_setopt($ch, CURLOPT_TIMEOUT, self::TUMBLR_API_TIMEOUT);
132 $data = curl_exec($ch);
133 $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Http.php (https://gitlab.com/cividesk-civicrm/com.cividesk.payment.braintree) PHP · 193 lines
1 <?php
2 namespace Braintree;
105 {
106 $curl = curl_init();
107 curl_setopt($curl, CURLOPT_TIMEOUT, $this->_config->timeout());
108 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
109 curl_setopt($curl, CURLOPT_URL, $url);
110 curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
112 $headers = $this->_getHeaders($curl);
113 $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
114 $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION;
Curl.php (https://gitlab.com/bhargavi_dcw/dflocal) PHP · 153 lines
1 <?php
2 /*
3 * Copyright 2014 Google Inc.
20 * @author Stuart Langley <slangley@google.com>
21 */
22 require_once realpath(dirname(__FILE__) . '/../../../autoload.php');
24 class Google_IO_Curl extends Google_IO_Abstract
42 $curl = curl_init();
43 if ($request->getPostBody()) {
44 curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getPostBody());
45 }
46 $requestHeaders = $request->getRequestHeaders();
50 $curlHeaders[] = "$k: $v";
51 }
52 curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaders);
53 }
54 curl_setopt($curl, CURLOPT_URL, $request->getUrl());
way2sms-api.php (https://github.com/kingster/Way2SMS-API.git) PHP · 147 lines
1 <?php
3 /**
31 // Go where the server takes you :P
32 curl_setopt($this->curl, CURLOPT_URL, "http://way2sms.com");
33 curl_setopt($this->curl, CURLOPT_HEADER, true);
34 curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, false);
35 curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, TRUE);
40 // Setup for login
41 curl_setopt($this->curl, CURLOPT_URL, $this->way2smsHost . "Login1.action");
42 curl_setopt($this->curl, CURLOPT_POST, 1);
43 curl_setopt($this->curl, CURLOPT_POSTFIELDS, "username=" . $uid . "&password=" . $pwd . "&button=Login");
44 curl_setopt($this->curl, CURLOPT_COOKIESESSION, 1);
ParanoidHTTPFetcher.php (https://bitbucket.org/stager94/skmz-joomla.git) PHP · 179 lines
1 <?php
2 // Check to ensure this file is within the rest of the framework
3 defined('JPATH_BASE') or die();
6 * This module contains the CURL-based HTTP fetcher implementation.
7 *
8 * PHP versions 4 and 5
9 *
10 * LICENSE: See the COPYING file included in this distribution.
19 * Interface import
20 */
21 require_once "Services/Yadis/HTTPFetcher.php";
23 /**
69 $c = curl_init();
70 if (defined('CURLOPT_NOSIGNAL')) {
71 curl_setopt($c, CURLOPT_NOSIGNAL, true);
72 }
subscriber.php (https://github.com/lmorchard/Tiny-Tiny-RSS.git) PHP · 120 lines
1 <?php
3 // a PHP client library for pubsubhubbub
92 // add any additional curl options here
93 $options = array(CURLOPT_URL => $url,
94 CURLOPT_USERAGENT => "PubSubHubbub-Subscriber-PHP/1.0",
95 CURLOPT_RETURNTRANSFER => true);
105 $ch = curl_init();
106 curl_setopt_array($ch, $options);
108 $response = curl_exec($ch);
ItellaEmmi.php (https://github.com/janipalsamaki/EMMi-client-PHP-API.git) PHP · 242 lines
api_class.php (https://bitbucket.org/elijahvsjesus/tandava.git) PHP · 272 lines
1 <?php
2 /**
3 * Twitter interface class
244 private function APICall($api_url, $require_credentials = false, $http_post = false) {
245 $curl_handle = curl_init();
246 curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
247 curl_setopt($curl_handle, CURLOPT_URL, $api_url);
248 if ($require_credentials) {
249 curl_setopt($curl_handle, CURLOPT_USERPWD, $this->credentials);
250 }
251 if ($http_post) {
252 curl_setopt($curl_handle, CURLOPT_POST, true);
253 }
254 curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
CargarDatosProductosxColor.php (https://gitlab.com/scsistemas/superprime) PHP · 125 lines
sagepay_us.php (https://bitbucket.org/allanxyh/uniquemall.git) PHP · 103 lines
Rest.php (https://github.com/back2arie/Panada.git) PHP · 230 lines
5 * @package Resources
6 * @link http://panadaframework.com/
7 * @license http://www.opensource.org/licenses/bsd-license.php
8 * @author Iskandar Soesman <k4ndar@yahoo.com>
9 * @since Version 0.1
111 /**
112 * See this trick at http://www.php.net/manual/en/function.curl-setopt.php#96056
113 *
114 * @return array
161 $c = curl_init();
163 curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
164 curl_setopt($c, CURLOPT_URL, $uri);
165 curl_setopt($c, CURLOPT_TIMEOUT, $this->timeout);
166 curl_setopt($c, CURLOPT_SSL_VERIFYPEER, $this->curlSSLVerifypeer);
Petfinder.php (https://github.com/wilhelser/Petfinder.git) PHP · 326 lines
1 <?php
3 /**
4 *----------------------------------------
5 * PHP Client Library for Petfinder.com API
6 * @author Brian Haveri
7 * @link http://github.com/brianhaveri/petfinder
263 CURLOPT_URL => $request,
264 CURLOPT_RETURNTRANSFER => TRUE,
265 CURLOPT_USERAGENT => __CLASS__.' PHP Client Library'
266 );
267 $ch = curl_init();
268 curl_setopt_array($ch, $curlOptions);
269 $data = curl_exec($ch);
270 curl_close($ch);
Api.php (https://gitlab.com/BenjaminHolm/wp-rocket) PHP · 252 lines
1 <?php
3 namespace Cloudflare;
203 $ch = curl_init();
204 curl_setopt_array($ch, $curl_options);
206 $json_data = json_encode($data);
208 if ($method === 'post') {
209 curl_setopt($ch, CURLOPT_POST, true);
210 curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
211 } elseif ($method === 'put') {
212 curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
213 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
HttpClientApi.php (https://gitlab.com/spejs/CrimeWatch) PHP · 111 lines
1 <?php
3 class Braintree_HttpClientApi extends Braintree_Http
22 {
23 $curl = curl_init();
24 curl_setopt($curl, CURLOPT_TIMEOUT, 60);
25 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
26 curl_setopt($curl, CURLOPT_URL, $url);
27 curl_setopt($curl, CURLOPT_HTTPHEADER, array(
29 'X-ApiVersion: ' . Braintree_Configuration::API_VERSION
30 ));
31 curl_setopt($curl, CURLOPT_USERPWD, $this->_config->publicKey() . ':' . $this->_config->privateKey());
33 if(!empty($requestBody)) {
Request.php (https://github.com/ornicar/mongoPHP.git) PHP · 231 lines
1 <?php
3 class GAS_Http_Curl_Request extends GAS {
187 }
189 curl_setopt( $this->_curl, CURLOPT_URL, $uri );
191 if( ( is_array( $this->_post ) !== false && count( $this->_post ) > 0 ) || ( is_array( $this->_post ) !== true && $this->_post != '' ) ) {
204 foreach( $this->_curlOpt as $constant => $value ) {
206 curl_setopt( $this->_curl, constant( $constant ), $value );
208 }
httpMgr.class.php (https://github.com/richhl/kalturaCE.git) PHP · 251 lines
1 <?php
2 /**
3 * Extends the 'kFileTransferMgr' class & implements a file transfer manager using the FTP protocol.
74 $this->ch = curl_init();
76 curl_setopt($this->ch, CURLOPT_USERAGENT, self::HTTP_USER_AGENT);
77 curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
79 curl_setopt($this->ch, CURLOPT_NOSIGNAL, true);
80 curl_setopt($this->ch, CURLOPT_FORBID_REUSE, true);
81 curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
83 curl_setopt($this->ch, CURLOPT_HEADER, false);
CurlRequest.php (https://gitlab.com/unofficial-mirrors/moodle) PHP · 200 lines
1 <?php
3 /**
18 * limitations under the License.
19 *
20 * PHP Version 5
21 *
22 * @file CAS/Request/CurlRequest.php
23 * @category Authentication
24 * @package PhpCAS
25 * @author Adam Franco <afranco@middlebury.edu>
26 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
27 * @link https://wiki.jasig.org/display/CASC/phpCAS
28 */
class-quiz-maker-pdfapi.php (https://github.com/livinglab/openlab.git) PHP · 223 lines
1 <?php
3 class Quiz_PDF_API {
12 $api_url = apply_filters( 'ays_quiz_pdfapi_api_url', $url );
14 curl_setopt_array($curl, array(
15 CURLOPT_URL => $api_url,
16 CURLOPT_RETURNTRANSFER => true,
113 $api_url = apply_filters( 'ays_quiz_pdfapi_api_report_url', $url );
115 curl_setopt_array($curl, array(
116 CURLOPT_URL => $api_url,
117 CURLOPT_RETURNTRANSFER => true,
168 $api_url = apply_filters( 'ays_quiz_pdfapi_api_report_public_url', $url );
170 curl_setopt_array($curl, array(
171 CURLOPT_URL => $api_url,
172 CURLOPT_RETURNTRANSFER => true,
CurlConsumer.php (https://gitlab.com/Blueprint-Marketing/mixpanel-php) PHP · 221 lines
1 <?php
2 require_once(dirname(__FILE__) . "/AbstractConsumer.php");
39 /**
40 * @var bool|null true to fork the cURL process (using exec) or false to use PHP's cURL extension. false by default
41 */
42 protected $_fork = null;
71 } else {
72 if (!function_exists('curl_init')) {
73 throw new Exception('The cURL PHP extension is required to use the cURL consumer with fork = false. Try setting fork = true or use another consumer.');
74 }
75 }
79 /**
80 * Write to the given host/endpoint using either a forked cURL process or using PHP's cURL extension
81 * @param array $batch
82 * @return bool
centaurosms.php (https://gitlab.com/adrianjose605/SaintW) PHP · 123 lines
1 <?php
2 /**
3 * Libreria de Integracion CentauroSMS v1.2
76 private static function get_connect($uri, $method, $content_type) {
77 $connect = curl_init(self::API_BASE_URL . $uri);
78 curl_setopt($connect, CURLOPT_RETURNTRANSFER, true);
79 curl_setopt($connect, CURLOPT_CUSTOMREQUEST, $method);
80 curl_setopt($connect, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-Type: " . $content_type));
81 return $connect;
82 }
96 }
97 }
98 curl_setopt($connect, CURLOPT_POSTFIELDS, $data);
99 }
100 private static function exec($method, $uri, $data, $content_type) {
ext.spamfreeform.php (https://github.com/amphibian/spamfreeform.ee_addon.git) PHP · 170 lines
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
3 class Spamfreeform_ext
115 $ch = curl_init($server);
116 curl_setopt($ch, CURLOPT_HEADER, 0);
117 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
118 curl_setopt($ch, CURLOPT_POST, 1);
119 curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
120 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
121 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
CouchDB.php (https://github.com/Luzifer/PHPFramework.git) PHP · 265 lines
ecb.php (https://github.com/ocStore/ocStore.git) PHP · 132 lines
1 <?php
2 class ControllerExtensionCurrencyEcb extends Controller {
3 private $error = array();
81 $curl = curl_init();
83 curl_setopt($curl, CURLOPT_URL, 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
84 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
85 curl_setopt($curl, CURLOPT_HEADER, false);
86 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
87 curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
88 curl_setopt($curl, CURLOPT_TIMEOUT, 30);
Paypalpro.php (https://gitlab.com/vince.omega/mcb-nov-build) PHP · 229 lines
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 /**
8 * @author Kohana Team
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
11 */
12 class Payment_Paypalpro_Driver implements Payment_Driver
200 // Set custom curl options
201 curl_setopt_array($ch, $this->curl_config);
203 // Set the curl POST fields
204 curl_setopt($ch, CURLOPT_POSTFIELDS, $nvp_qstr);
206 // Execute post and get results
function.curl-multi-close.html (https://bitbucket.org/thncr/manuals.git) HTML · 94 lines
10 <div class="next" style="text-align: right; float: right;"><a href="function.curl-multi-exec.html">curl_multi_exec</a></div>
11 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
12 <div class="home"><a href="index.html">PHP Manual</a></div>
13 </div><hr /><div id="function.curl-multi-close" class="refentry">
14 <div class="refnamediv">
15 <h1 class="refname">curl_multi_close</h1>
16 <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">curl_multi_close</span> — <span class="dc-title">关闭一组cURL句柄</span></p>
18 </div>
67 <div class="phpcode"><code><span style="color: #000000">
68 <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// 创建一对cURL资源<br /></span><span style="color: #0000BB">$ch1 </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$ch2 </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// 设置URL和相应的选项<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch1</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">, </span><span style="color: #DD0000">"http://www.example.com/"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch1</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_HEADER</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch2</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">, </span><span style="color: #DD0000">"http://www.php.net/"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch2</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_HEADER</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 创建批处理cURL句柄<br /></span><span style="color: #0000BB">$mh </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_multi_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// 增加2个句柄<br /></span><span style="color: #0000BB">curl_multi_add_handle</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">,</span><span style="color: #0000BB">$ch1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_multi_add_handle</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">,</span><span style="color: #0000BB">$ch2</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$running</span><span style="color: #007700">=</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">// 执行批处理句柄<br /></span><span style="color: #007700">do {<br /> </span><span style="color: #0000BB">curl_multi_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">,</span><span style="color: #0000BB">$running</span><span style="color: #007700">);<br />} while (</span><span style="color: #0000BB">$running </span><span style="color: #007700">> </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 关闭全部句柄<br /></span><span style="color: #0000BB">curl_multi_remove_handle</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">, </span><span style="color: #0000BB">$ch1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_multi_remove_handle</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">, </span><span style="color: #0000BB">$ch2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_multi_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mh</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span>
69 </span>
70 </code></div>
91 <div class="next" style="text-align: right; float: right;"><a href="function.curl-multi-exec.html">curl_multi_exec</a></div>
92 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
93 <div class="home"><a href="index.html">PHP Manual</a></div>
94 </div></body></html>
mp3info.php (https://github.com/somefool/habari-extras.git) PHP · 275 lines
1 <?php
3 require_once( 'mp3frameheader.php' );
250 $ch = curl_init();
252 curl_setopt( $ch, CURLOPT_URL, $file_name ); // The URL.
253 curl_setopt( $ch, CURLOPT_MAXREDIRS, 5 ); // Maximum number of redirections to follow.
254 curl_setopt( $ch, CURLOPT_CRLF, true ); // Convert UNIX newlines to \r\n.
255 curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); // Follow 302's and the like.
256 curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
257 curl_setopt( $ch, CURLOPT_TIMEOUT, $timeout );
258 curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers ); // headers to send
260 $th = fopen( $tmp, 'wb' );
Http.php (https://gitlab.com/hunt9310/ras) PHP · 182 lines
1 <?php
2 namespace Braintree;
105 {
106 $curl = curl_init();
107 curl_setopt($curl, CURLOPT_TIMEOUT, 60);
108 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
109 curl_setopt($curl, CURLOPT_URL, $url);
110 curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
112 $headers = $this->_getHeaders($curl);
113 $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
114 $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION;
CurlService.php (https://github.com/instaclick/php-webdriver.git) PHP · 137 lines
1 <?php
3 /**
48 $curl = curl_init($url);
49 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
51 switch ($requestMethod) {
55 case 'POST':
56 if ($parameters && is_array($parameters)) {
57 curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
58 } else {
59 $customHeaders[] = 'Content-Length: 0';
68 $customHeaders[] = 'Expect:';
70 curl_setopt($curl, CURLOPT_POST, true);
71 break;
LanguageTranslator.php (https://gitlab.com/klausmig/CloudSemanticWeb) PHP · 239 lines
1 <?php
3 class LanguageTranslator
39 // tell cURL to return the response rather than outputting it
40 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
42 //for the problems of SSL
43 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
45 // write the form data to the request in the post body
46 curl_setopt($ch, CURLOPT_POSTFIELDS, $formData);
48 // include the header to make Google treat this post request as a get request
OAuth2Client.php (https://bitbucket.org/paulkish/no-cms.git) PHP · 243 lines
1 <?php
2 /*!
3 * HybridAuth
32 public $curl_ssl_verifypeer = false;
33 public $curl_header = array();
34 public $curl_useragent = "OAuth/2 Simple PHP Client v0.1; HybridAuth http://hybridauth.sourceforge.net/";
35 public $curl_authenticate_method = "POST";
36 public $curl_proxy = null;
199 $ch = curl_init();
201 curl_setopt($ch, CURLOPT_URL , $url );
202 curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1 );
203 curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out );
204 curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent );
Curl.class.php (https://gitlab.com/fangjianwei/weifenxiao) PHP · 186 lines
1 <?php
2 /**
3 * 重写Curl类
23 static function get($url){
24 $ch = curl_init($url);
25 curl_setopt($ch, CURLOPT_HTTPHEADER, self::$headers);
26 curl_setopt($ch, CURLOPT_HEADER, 0);
27 curl_setopt($ch, CURLOPT_USERAGENT, self::$user_agent);
28 curl_setopt($ch, CURLOPT_ENCODING, self::$compression);
29 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
30 if(self::$proxy) curl_setopt($ch, CURLOPT_PROXY, self::$proxy);
31 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
32 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
CURLMessage.php (https://bitbucket.org/ferOnti/processmaker.git) PHP · 156 lines
1 <?php
2 /**
3 * Abstract class containing the CURL functionality, used to handle GET, POST, PUT and DELETE http methods.
48 $this->ch = curl_init();
49 curl_setopt( $this->ch, CURLOPT_TIMEOUT, 2 );
50 curl_setopt( $this->ch, CURLOPT_POST, 1 );
51 curl_setopt( $this->ch, CURLOPT_RETURNTRANSFER, 1 );
52 }
87 public function sendGET ($method, array $message)
88 {
89 curl_setopt( $this->ch, CURLOPT_HTTPGET, true );
90 return $this->send( $method, $message );
91 }
Api.php (https://bitbucket.org/seth_sokol/ieltsonabike.git) PHP · 295 lines
1 <?php
2 namespace Uploadcare;
234 case REQUEST_TYPE_POST:
235 case 'POST':
236 curl_setopt($ch, CURLOPT_POST, true);
237 break;
238 case REQUEST_TYPE_PUT:
239 case 'PUT':
240 curl_setopt($ch, CURLOPT_PUT, true);
241 break;
242 case REQUEST_TYPE_DELETE:
243 case 'DELETE':
244 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
245 break;
246 case REQUEST_TYPE_HEAD:
CurlMultiRequest.php (https://github.com/markn86/moodle.git) PHP · 147 lines
1 <?php
3 /**
18 * limitations under the License.
19 *
20 * PHP Version 5
21 *
22 * @file CAS/Request/AbstractRequest.php
23 * @category Authentication
24 * @package PhpCAS
25 * @author Adam Franco <afranco@middlebury.edu>
26 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
27 * @link https://wiki.jasig.org/display/CASC/phpCAS
28 */
ParanoidHTTPFetcher.php (https://github.com/Emaratilicious/Garden.git) PHP · 226 lines
1 <?php
3 /**
4 * This module contains the CURL-based HTTP fetcher implementation.
5 *
6 * PHP versions 4 and 5
7 *
8 * LICENSE: See the COPYING file included in this distribution.
17 * Interface import
18 */
19 require_once "Auth/Yadis/HTTPFetcher.php";
21 require_once "Auth/OpenID.php";
101 if (defined('CURLOPT_NOSIGNAL')) {
102 curl_setopt($c, CURLOPT_NOSIGNAL, true);
103 }
ElasticSearchTransportHTTP.php (https://github.com/ibotty/elasticsearch.git) PHP · 246 lines
1 <?php // vim:set ts=4 sw=4 et:
2 require_once 'ElasticSearchTransportHTTPException.php';
169 $protocol = "http";
170 $requestURL = $protocol . "://" . $this->host . $url;
171 curl_setopt($conn, CURLOPT_URL, $requestURL);
172 curl_setopt($conn, CURLOPT_TIMEOUT, self::TIMEOUT);
173 curl_setopt($conn, CURLOPT_PORT, $this->port);
174 curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1) ;
175 curl_setopt($conn, CURLOPT_CUSTOMREQUEST, strtoupper($method));
176 curl_setopt($conn, CURLOPT_FORBID_REUSE , 0) ;
178 if (is_array($payload) && count($payload) > 0)
179 curl_setopt($conn, CURLOPT_POSTFIELDS, json_encode($payload)) ;
180 else
181 curl_setopt($conn, CURLOPT_POSTFIELDS, null);
SoapRequester.php (https://bitbucket.org/6dg/dynamics-crm-php-connector.git) PHP · 271 lines
98 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
99 curl_setopt($ch, CURLOPT_TIMEOUT, 60);
100 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
101 curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
102 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
103 curl_setopt($ch, CURLOPT_POST, true);
156 {
157 if ($responseDOM->getElementsByTagNameNS(SoapRequester::$soapEnvelope, 'Envelope')->length < 1) {
158 throw new \Exception('Invalid SOAP Response: HTTP Response ' . $responseXML . PHP_EOL . $responseXML . PHP_EOL);
159 }
160 }
203 if (!$header) {
204 throw new \Exception('Invalid SOAP Response: No SOAP Header!' . PHP_EOL . $responseXML . PHP_EOL);
205 }
206 }
curl.php (https://github.com/michael-lefebvre/core.git) PHP · 251 lines
1 <?php
3 namespace Fuel\Core;
22 if ( ! function_exists('curl_init'))
23 {
24 throw new \RuntimeException('Your PHP installation doesn\'t have cURL enabled. Rebuild PHP with --with-curl');
25 }
148 $connection = $this->connection();
150 curl_setopt_array($connection, $this->options);
152 // Execute the request & and hide all output
curl.constants.html (https://bitbucket.org/thncr/manuals.git) HTML · 3201 lines
10 <div class="next" style="text-align: right; float: right;"><a href="curl.examples.html">范例</a></div>
11 <div class="up"><a href="book.curl.html">cURL</a></div>
12 <div class="home"><a href="index.html">PHP Manual</a></div>
13 </div><hr /><div id="curl.constants" class="appendix">
14 <h1>预定义常量</h1>
16 <p class="simpara">下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
17 <p class="para">
18 Descriptions and uses for these constants are described within the
19 <span class="function"><a href="function.curl-setopt.html" class="function">curl_setopt()</a></span> and <span class="function"><a href="function.curl-getinfo.html" class="function">curl_getinfo()</a></span>
20 documentation.
21 </p>
globals.php (https://github.com/jtzl/oauth_twitter.git) PHP · 227 lines
1 <?php
2 /**
3 * Globals and utilities for OAuth Examaples package
98 // Set curl options that were passed in
99 curl_setopt_array($ch, $curl_opts);
101 // Ensure that we receive full header
102 curl_setopt($ch, CURLOPT_HEADER, true);
104 if ($debug) {
164 * @param bool $html_output true if the output should be escaped
165 * (for use in HTML)
166 * @link http://us2.php.net/manual/en/function.json-encode.php#80339
167 */
168 function json_pretty_print($json, $html_output=false)
XML.php (https://github.com/davissuperman/tuangou.git) PHP · 186 lines
1 <?php
2 class XML {
3 protected $_file = null;
21 $srcurl = $path;
22 $curl = curl_init ();
23 curl_setopt ( $curl, CURLOPT_URL, $srcurl );
24 curl_setopt ( $curl, CURLOPT_HEADER, 0 );
25 curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, 1 );
26 $htmldata = curl_exec ( $curl );
27 $htmldata = preg_replace ( '/&/', '&', $htmldata );
engage.api.lib.php (https://github.com/kevinelong/Janrain-Sample-Code.git) PHP · 202 lines
1 <?php
2 /**
3 * Copyright 2011
56 engage_define('ENGAGE_JERROR_SYN', ', malformed JSON');
57 if (ENGAGE_DEV_MODE === true) {
58 if (!version_compare(PHP_VERSION, '5.0.0', '>=')){
59 engage_error('PHP version less than required version', __FUNCTION__);
145 }
146 engage_error('parameters: ' . print_r($parameters, true), __FUNCTION__, ENGAGE_ELABEL_DEBUG);
147 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
148 curl_setopt($curl, CURLOPT_URL, $url);
149 curl_setopt($curl, CURLOPT_POST, true);
150 curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters);
151 curl_setopt($curl, CURLOPT_HEADER, false);
152 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
Api.php (https://bitbucket.org/ZephyrQG2/sf2bundleeditable.git) PHP · 302 lines
1 <?php
2 /**
3 * @file
241 case REQUEST_TYPE_POST:
242 case 'POST':
243 curl_setopt($ch, CURLOPT_POST, true);
244 break;
245 case REQUEST_TYPE_PUT:
246 case 'PUT':
247 curl_setopt($ch, CURLOPT_PUT, true);
248 break;
249 case REQUEST_TYPE_DELETE:
250 case 'DELETE':
251 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
252 break;
253 case REQUEST_TYPE_HEAD:
test.php (https://github.com/oskarp/4ME102.git) PHP · 126 lines
1 <?
2 class PhpReverseProxy{
3 public $port,$host,$content,$forward_path,$content_type,$user_agent,
4 $XFF,$request_method,$IMS,$cacheTime,$cookie;
5 private $http_code,$lastModified,$version,$resultHeader;
6 function __construct(){
7 $this->version="PHP Reverse Proxy (PRP) 1.0";
8 $this->port="8080";
9 $this->host="127.0.0.1";
62 curl_setopt($ch, CURLOPT_POST,1);
63 curl_setopt($ch, CURLOPT_POSTFIELDS,file_get_contents("php://input"));
64 }
65 curl_setopt($ch,CURLOPT_URL,$this->translateURL($this->host));
66 curl_setopt($ch,CURLOPT_HTTPHEADER,
67 Array(
68 "X-Forwarded-For: ".$this->XFF,
images.php (https://gitlab.com/franheit_krya/digitalocean-dashboard) PHP · 92 lines
1 <?php require_once '../main/header.php'; ?>
2 <div class="container-fluid">
3 <div class="row">
4 <?php require_once '../main/sidebar.php'; ?>
5 <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main do-images">
6 <table id="digitaloceantable" class="table table-hover">
19 </thead>
20 <tbody>
21 <?php
22 $endpoint = "https://api.digitalocean.com/v2/images?private=true";
23 $headers[] = "Content-type: application/json";
24 $headers[] = "Authorization: Bearer $DO_API_TOKEN";
25 $curl = curl_init();
26 curl_setopt_array($curl, [
27 CURLOPT_HTTPHEADER => $headers,
28 CURLOPT_RETURNTRANSFER => true,
Http.php (https://github.com/darkyoung/Elastica.git) PHP · 149 lines
1 <?php
2 /**
3 * Elastica Http Transport object
58 }
60 curl_setopt($conn, CURLOPT_URL, $baseUri);
61 curl_setopt($conn, CURLOPT_TIMEOUT, $request->getConfig('timeout'));
62 curl_setopt($conn, CURLOPT_CUSTOMREQUEST, $request->getMethod());
63 curl_setopt($conn, CURLOPT_FORBID_REUSE, 0);
72 }
74 curl_setopt($conn, CURLOPT_HTTPHEADER, $headers);
75 }
Isolation.php (https://gitlab.com/Blueprint-Marketing/hhvm) PHP · 255 lines
6 * Use this by setting:
7 * - hhvm.jit_enable_rename_function=true
8 * - auto_prepend_file=/path/to/Isolation.php
9 */
37 public static function CheckWriteFile(string $path) {
38 $scheme = parse_url($path, PHP_URL_SCHEME);
39 if ($scheme === 'vfs') {
40 // vfsstream already provides isolation for unit tests, allow it
41 return;
42 } else if ($scheme === 'php') {
43 // memory, temp, etc
44 return;
VoiceVault.php (https://github.com/MichaelMackus/OpenVBX.git) PHP · 157 lines
1 <?php
3 /**
104 {
105 $result = $this->doRequest($this->_api_url.'/SubmitPhrase.ashx',
106 // 'http://localhost/sendshorty/index.php/VoiceVault/default/test',
107 'POST',
108 array(
141 $ch = curl_init($url);
143 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
145 if ($method == 'POST') {
146 curl_setopt($ch, CURLOPT_POST, 1);
147 }
HttpClientApi.php (https://gitlab.com/hunt9310/ras) PHP · 116 lines
1 <?php
2 namespace Test\Integration;
4 require_once dirname(__DIR__) . '/Setup.php';
6 use Braintree;
27 {
28 $curl = curl_init();
29 curl_setopt($curl, CURLOPT_TIMEOUT, 60);
30 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
31 curl_setopt($curl, CURLOPT_URL, $url);
32 curl_setopt($curl, CURLOPT_HTTPHEADER, [
LoginzaListener.php (https://github.com/zim32/Loginza-for-Symfony-2.git) PHP · 87 lines
1 <?php
3 namespace Zim32\LoginzaBundle\DependencyInjection\Security;
31 $signature = md5($loginzaToken.$this->container->getParameter('security.loginza.secret_key'));
32 $ch = curl_init("http://loginza.ru/api/authinfo?token={$loginzaToken}&id={$this->container->getParameter('security.loginza.widget_id')}&sig={$signature}");
33 curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
34 $result = curl_exec($ch);
35 $decoded = json_decode($result,true);
Uploader.php (https://bitbucket.org/seth_sokol/ieltsonabike.git) PHP · 238 lines
1 <?php
2 namespace Uploadcare;
189 private function __setRequestType($ch)
190 {
191 curl_setopt($ch, CURLOPT_POST, true);
192 }
200 private function __setHeaders($ch)
201 {
202 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
203 curl_setopt($ch, CURLOPT_HTTPHEADER, array(
204 'User-Agent: PHP Uploadcare Module '.$this->api->version,
205 ));
206 }
function.curl-close.html (https://github.com/cue-taro/emacs-setting-files.git) HTML · 92 lines
10 <div class="next" style="text-align: right; float: right;"><a href="function.curl-copy-handle.html">curl_copy_handle</a></div>
11 <div class="up"><a href="ref.curl.html">cURL 関数</a></div>
12 <div class="home"><a href="index.html">PHP Manual</a></div>
13 </div><hr /><div id="function.curl-close" class="refentry">
14 <div class="refnamediv">
15 <h1 class="refname">curl_close</h1>
16 <p class="verinfo">(PHP 4 >= 4.0.2, PHP 5)</p><p class="refpurpose"><span class="refname">curl_close</span> — <span class="dc-title">cURL セッションを閉じる</span></p>
18 </div>
66 <div class="phpcode"><code><span style="color: #000000">
67 <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// 新しい cURL リソースを作成します<br /></span><span style="color: #0000BB">$ch </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// URL とその他のオプションを設定します<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">, </span><span style="color: #DD0000">"http://www.example.com/"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">, </span><span style="color: #0000BB">CURLOPT_HEADER</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// URL を取得し、それをブラウザに渡します<br /></span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// cURL リソースを閉じ、システムリソースを解放します<br /></span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
68 </span>
69 </code></div>
89 <div class="next" style="text-align: right; float: right;"><a href="function.curl-copy-handle.html">curl_copy_handle</a></div>
90 <div class="up"><a href="ref.curl.html">cURL 関数</a></div>
91 <div class="home"><a href="index.html">PHP Manual</a></div>
92 </div></body></html>
library.ucursos.scrapper.php (https://github.com/rduenasf/ucursos-scrapper.git) PHP · 106 lines
1 <?php
2 require('phpQuery/phpQuery.php');
3 class UcursosScrapper {
16 curl_setopt($this->curl_handler, CURLOPT_HEADER, 0);
17 curl_setopt($this->curl_handler, CURLOPT_FOLLOWLOCATION, 1);
18 curl_setopt($this->curl_handler, CURLOPT_SSL_VERIFYPEER, false);
48 function fetch($url, $output_format = 'UTF-8') {
49 $this->url = $url;
50 curl_setopt($this->curl_handler, CURLOPT_URL, $this->url);
51 $this->content = curl_exec($this->curl_handler);
52 $info = curl_getinfo($this->curl_handler);
68 if (!$this->processed) {
69 $this->processed = true;
70 $this->phpQueryDocument = phpQuery::newDocumentHTML($this->content);
71 phpQuery::selectDocument($this->phpQueryDocument);
HttpHelper.php (https://github.com/stwalkerster/waca.git) PHP · 124 lines
1 <?php
2 /******************************************************************************
3 * Wikipedia Account Creation Assistance tool *
26 $this->curlHandle = curl_init();
28 curl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, true);
29 curl_setopt($this->curlHandle, CURLOPT_USERAGENT, $siteConfiguration->getUserAgent());
30 curl_setopt($this->curlHandle, CURLOPT_FAILONERROR, true);
32 if ($siteConfiguration->getCurlDisableVerifyPeer()) {
33 curl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, false);
34 }
Client.php (https://github.com/sendtogeo/Seo-Panel.git) PHP · 218 lines
1 <?php
3 /**
4 * HTTP Client library
5 *
6 * PHP version 5.4
7 *
8 * @author Matt Bernier <dx@sendgrid.com>
11 * @license https://opensource.org/licenses/MIT The MIT License
12 * @version GIT: <git_id>
13 * @link http://packagist.org/packages/sendgrid/php-http-client
14 */
142 $curl = curl_init($url);
144 curl_setopt_array($curl, [
145 CURLOPT_RETURNTRANSFER => true,
146 CURLOPT_HEADER => 1,
EpiOAuth.php (https://github.com/krillo/bandybot_old.git) PHP · 233 lines
1 <?php
2 class EpiOAuth
3 {
75 $_h[] = substr($oauth, 0, -1);
77 curl_setopt($ch, CURLOPT_HTTPHEADER, $_h);
78 }
122 $ch = curl_init($url);
123 $this->addOAuthHeaders($ch, $url, $params['oauth']);
124 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
125 $resp = $this->curl->addCurl($ch);
132 $ch = curl_init($url);
133 $this->addOAuthHeaders($ch, $url, $params['oauth']);
134 curl_setopt($ch, CURLOPT_POST, 1);
135 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params['request']));
HiveMC-PHP.php (https://gitlab.com/billyprice1/HiveMC-PHP) PHP · 304 lines
1 <?php
3 namespace HiveMCPHP;
5 /**
6 * Class HiveMCPHP
7 * Capital 'H' because of the name Hive, which refers to The Hive.
8 *
10 * @copyright 2016 Max Korlaar
11 * @license MIT
12 * @credit to @Plancke for inspiring me in how some things are handled in his HypixelPHP, for example the folder structure for caching files.
13 * @package HiveMCPHP
14 */
15 class HiveMCPHP
16 {
17 protected $options = [];
Curl.php (https://gitlab.com/hop23typhu/list-theme) PHP · 139 lines
1 <?php
2 /*
3 * Copyright 2014 Google Inc.
22 */
24 require_once realpath(dirname(__FILE__) . '/../../../autoload.php');
26 class Google_IO_Curl extends Google_IO_Abstract
44 if ($request->getPostBody()) {
45 curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getPostBody());
46 }
52 $curlHeaders[] = "$k: $v";
53 }
54 curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaders);
55 }
weatherpitch.php (https://github.com/chopsuei3/oscc.git) PHP · 113 lines
13 </tr>
15 <?php
45 $cURL = curl_init();
46 curl_setopt($cURL, CURLOPT_URL, $url);
47 curl_setopt($cURL, CURLOPT_HTTPGET, true);
48 curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
49 curl_setopt($cURL, CURLOPT_HTTPHEADER, array(
51 'Accept: application/json'
52 ));
53 curl_setopt($cURL, CURLOPT_FAILONERROR, false);
55 $result = curl_exec($cURL);
envio_hacienda.php (https://gitlab.com/D-apos-software/api-hacienda) PHP · 266 lines
1 <?php
2 /*
3 * Copyright (C) 2017-2020 CRLibre <https://crlibre.org>
97 $curl = curl_init($url);
98 curl_setopt($curl, CURLOPT_HEADER, true);
99 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
100 curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
101 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
102 curl_setopt($curl, CURLOPT_POSTFIELDS, $mensaje);
103 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
104 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
105 $respuesta = curl_exec($curl);
106 $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl.class.php (https://gitlab.com/fangjianwei/weifenxiao) PHP · 182 lines
1 <?php
2 namespace Common\Library\Curl;
3 use Common\Library\Curl\crypt;
22 static function get($url){
23 $ch = curl_init($url);
24 curl_setopt($ch, CURLOPT_HTTPHEADER, self::$headers);
25 curl_setopt($ch, CURLOPT_HEADER, 0);
26 curl_setopt($ch, CURLOPT_USERAGENT, self::$user_agent);
27 curl_setopt($ch, CURLOPT_ENCODING, self::$compression);
28 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
29 if(self::$proxy) curl_setopt($ch, CURLOPT_PROXY, self::$proxy);
30 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
31 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
MailchimpConnection.php (https://github.com/Jhut89/Mailchimp-API-3.0-PHP.git) PHP · 328 lines
1 <?php
3 namespace MailchimpAPI\Requests;
19 * Custom user agent for this library
20 */
21 const USER_AGENT = 'jhut89/Mailchimp-API-3.0-PHP (https://github.com/Jhut89/Mailchimp-API-3.0-PHP)';
23 /**
255 public function setOption($name, $value)
256 {
257 curl_setopt($this->handle, $name, $value);
258 $this->current_options[$name] = $value;
259 }
XEHttpRequest.class.php
(http://xe-core.googlecode.com/svn/trunk/)
PHP · 245 lines
✨ Summary
This is a PHP class that allows you to send HTTP requests and receive responses from an external server. It provides methods for setting request headers, sending GET, POST, PUT, and DELETE requests, and parsing the response body as JSON or XML.
This is a PHP class that allows you to send HTTP requests and receive responses from an external server. It provides methods for setting request headers, sending GET, POST, PUT, and DELETE requests, and parsing the response body as JSON or XML.
1 <?php
3 /**
199 // set URL and other appropriate options
200 curl_setopt($ch, CURLOPT_URL, "http://{$this->m_host}{$target}");
201 curl_setopt($ch, CURLOPT_HEADER, FALSE);
202 curl_setopt($ch, CURLOPT_PORT, $this->m_port);
203 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
204 curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
205 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
207 switch($method)
208 {
209 case 'GET': curl_setopt($ch, CURLOPT_HTTPGET, true);
210 break;
211 case 'PUT': curl_setopt($ch, CURLOPT_PUT, true);
quicksocial.php (https://github.com/nguyennamtien/appleseed.git) PHP · 302 lines
curl_lib.php (https://gitlab.com/asosab/ws-geo) PHP · 219 lines
limfunction.php (https://gitlab.com/earthm/vote_api_full) PHP · 332 lines
1 <?php
2 error_reporting(E_ALL);
3 ini_set("display_errors", 1);
4 include("config.php");
16 );
18 curl_setopt_array($curl,$curl_options);
20 if($result = curl_exec($curl)) {
197 function friends($uid, $friend = 0){
199 $url = base_URL."friends/index.php?uid=".$uid; //// get friend data from limpanzee db
200 $header = array(
201 'X-LIMP-SESSION:'.session_id()
CurlTransport.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 283 lines
1 <?php
2 /**
3 * Magento
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
22 * @package Tests_Functional
23 * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
75 // apply additional options to cURL
76 foreach ($this->_options as $option => $value) {
77 curl_setopt($this->_getResource(), $option, $value);
78 }
79 if (empty($this->_config)) {
client.php (https://github.com/decthomas/forkcms.git) PHP · 271 lines
1 <?php
3 /**
73 {
74 // check if curl is available
75 if(!function_exists('curl_init')) throw new SpoonFileException('This method requires cURL (http://php.net/curl), it seems like the extension isn\'t installed.');
77 // init var
142 // set options
143 curl_setopt_array($curl, $options);
145 // execute
Stripe.php (https://gitlab.com/Anas7232/Layout-Changes) PHP · 127 lines
profile_model.php (https://bitbucket.org/amitholkar/zenfile-18-05.git) PHP · 196 lines
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
3 class Profile_model extends CI_Model
80 $ch = curl_init($url);
81 curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
82 curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); // allow redirects
83 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
84 curl_setopt($ch, CURLOPT_HEADER, FALSE);
85 curl_setopt($ch, CURLOPT_TIMEOUT, 10); // times out after Ns
87 $raw_result = curl_exec($ch); // run the whole process
util.php (https://github.com/aramk/IMDb-Scraper.git) PHP · 179 lines
closurecompiler.php (https://gitlab.com/lankerd/paGO---Testing-Site) PHP · 141 lines
1 <?php
2 /**
3 * Class Minify_JS_ClosureCompiler
95 } elseif (defined('CURLOPT_POST')) {
96 $ch = curl_init(self::URL);
97 curl_setopt($ch, CURLOPT_POST, true);
98 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
99 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));
100 curl_setopt($ch, CURLOPT_POSTFIELDS, $postBody);
101 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
102 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
MRBase.class.php (https://github.com/webaaz/aperophp.git) PHP · 427 lines
1 <?php
3 class MRBase
148 }
150 curl_setopt($curlHandle, CURLOPT_POST, true);
151 curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $this->requestBody);
161 }
163 curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $this->requestBody);
164 curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT');
169 protected function executeDelete($curlHandle)
170 {
171 curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');
173 $this->doExecute($curlHandle);
github.php (https://github.com/ianmacl/pulltester.git) PHP · 188 lines
1 <?php
2 /**
3 * @package Joomla.Platform
12 jimport('joomla.environment.uri');
13 jimport('joomla.client.http');
14 JLoader::register('JHttpResponse', JPATH_PLATFORM.'/joomla/client/http.php');
15 jimport('joomla.client.github.githubpulls');
16 jimport('joomla.client.github.githubgists');
173 }
175 curl_setopt_array($this->http, $curl_options);
177 $response = new JHttpResponse;
Response.php (https://gitlab.com/x33n/grav) PHP · 219 lines
class-wc-https.php (https://gitlab.com/hunt9310/ras) PHP · 131 lines
customcss.php (https://gitlab.com/kernapps/kern-es-showdown) PHP · 103 lines
1 <?php
3 include '../pokemonshowdown.com/config/servers.inc.php';
39 $curl = curl_init($customcssuri);
40 if ($lastmodified && !$invalidate) {
41 curl_setopt($curl, CURLOPT_HTTPHEADER, array(
42 'If-Modified-Since: ' . gmdate('D, d M Y H:i:s T', $lastmodified),
43 'User-Agent: PSCustomCSS/0.1 (server=' . $server . ($invalidate ? '; invalidate=1' : '') . ')',
45 ));
46 } else {
47 curl_setopt($curl, CURLOPT_HTTPHEADER, array(
48 'User-Agent: PSCustomCSS/0.1 (server=' . $server . ($invalidate ? '; invalidate=1' : '') . ')',
49 // 'X-Forwarded-For: ' . @$_SERVER['HTTP_X_FORWARDED_FOR'],
50 ));
51 }
52 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
53 curl_setopt($curl, CURLOPT_MAXREDIRS, 5);
script_day_online.php (https://gitlab.com/xusasuke6/Slg_php) PHP · 104 lines
5 include "../../../config/config.center.online.php";
6 include SYSDIR_ADMIN.'/include/api_global.php';
68 $config_file = fopen('../../../config/config.center.online.php', 'wb');
69 fwrite($config_file, "<?php\n\$PLAY_ONLINE_TIME = " . var_export($PLAY_ONLINE_TIME, TRUE) . ";\n");
70 fclose($config_file);
71 echo strftime("%Y-%m-%d %H:%M:%S",time())." finish running pay log script";
90 $param_str = substr($url, $i + 1);
91 $url = substr($url, 0, $i);
92 curl_setopt($ch, CURLOPT_POST, 1);
93 curl_setopt($ch, CURLOPT_POSTFIELDS, $param_str);
96 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
97 curl_setopt($ch, CURLOPT_USERAGENT, 'WEB.4399.COM API PHP Servert 0.1 (curl) ' . phpversion());
98 curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
EpiCurl.php (https://github.com/diagonalfish/allmyfriendssay.git) PHP · 212 lines
1 <?php
2 class EpiCurl
3 {
37 $key = $this->getKey($ch);
38 $this->requests[$key] = $ch;
39 curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'headerCallback'));
40 $done = array('handle' => $ch);
41 $this->storeResponse($done, false);
48 $key = $this->getKey($ch);
49 $this->requests[$key] = $ch;
50 curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'headerCallback'));
52 $code = curl_multi_add_handle($this->mc, $ch);
currency.php (https://bitbucket.org/allanxyh/uniquemall.git) PHP · 150 lines
1 <?php
2 class ModelLocalisationCurrency extends Model {
3 public function addCurrency($data) {
118 $curl = curl_init();
120 curl_setopt($curl, CURLOPT_URL, 'http://download.finance.yahoo.com/d/quotes.csv?s=' . implode(',', $data) . '&f=sl1&e=.csv');
121 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);