当前位置: 首页>>代码示例>>PHP>>正文


PHP Curl::put方法代码示例

本文整理汇总了PHP中Curl::put方法的典型用法代码示例。如果您正苦于以下问题:PHP Curl::put方法的具体用法?PHP Curl::put怎么用?PHP Curl::put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Curl的用法示例。


在下文中一共展示了Curl::put方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPutFileHandle

 public function testPutFileHandle()
 {
     $png = $this->create_png();
     $tmp_file = $this->create_tmp_file($png);
     $this->curl->setOpt(CURLOPT_PUT, TRUE);
     $this->curl->setOpt(CURLOPT_INFILE, $tmp_file);
     $this->curl->setOpt(CURLOPT_INFILESIZE, strlen($png));
     $this->curl->put(self::TEST_URL . '/server.php', array('test' => 'put_file_handle'));
     fclose($tmp_file);
     $this->assertTrue($this->curl->response === 'image/png');
 }
开发者ID:php-mod,项目名称:curl,代码行数:11,代码来源:CurlTest.php

示例2: putFile

 /**
  * @param      $filePath
  * @param null $size
  *
  * @return mixed
  * @throws Exception
  */
 public function putFile($filePath, $size = null)
 {
     $resource = fopen($filePath, 'r');
     $response = $this->curl->put($resource, $size ? $size : filesize($filePath))->execute();
     fclose($resource);
     return $response;
 }
开发者ID:chenshuhao,项目名称:BeginShake,代码行数:14,代码来源:Client.php

示例3: setTimes

 public function setTimes($path, $modificationTime = '', $accessTime = '')
 {
     $url = $this->_buildUrl($path, array('op' => 'SETTIMES', 'modificationtime' => $modificationTime, 'accesstime' => $accessTime));
     return Curl::put($url);
 }
开发者ID:vmanoria,项目名称:php-WebHDFS,代码行数:5,代码来源:WebHDFS.php

示例4: _call

 private function _call($call, $data = FALSE, $type = FALSE)
 {
     switch ($type) {
         case "post":
             $curl = new Curl();
             $url = $this->api_host . $call . "?key={$this->key}";
             $response = $curl->post($url, $data);
             $response = json_decode($response->body);
             return $response;
             break;
         case "put":
             $curl = new Curl();
             $url = $this->api_host . $call . "?key={$this->key}";
             $response = $curl->put($url, $data);
             $response = json_decode($response->body);
             return $response;
             break;
         case "delete":
             $curl = new Curl();
             $url = $this->api_host . $call . "?key={$this->key}";
             $response = $curl->request('DELETE', $url, $data);
             $response = json_decode($response->body);
             return $response;
             break;
         default:
             $data["key"] = $this->key;
             $curl = new Curl();
             //$url = $this->api_host . $call . "?key=$this->key";
             $url = $this->api_host . $call;
             $response = $curl->get($url, $data);
             $response = json_decode($response->body);
             return $response;
             break;
     }
 }
开发者ID:TheCypher,项目名称:hostvirtual-php-sdk,代码行数:35,代码来源:vr_cloud.inc.php

示例5: put

 public static function put($path, $data)
 {
     $curl = new Curl();
     $curl->put(\Slim\Slim::getInstance()->globalConfig['oaUrl'] . $path, $data);
     return json_decode($curl->response->form, TRUE);
 }
开发者ID:aslijiasheng,项目名称:jacksonslim,代码行数:6,代码来源:CurlPlugin.class.php

示例6: put

 public function put($resource, array $params = array())
 {
     $url = $this->buildUrl($resource);
     $curl = new Curl();
     return $curl->put($url, $params);
 }
开发者ID:everlution,项目名称:rest-client,代码行数:6,代码来源:Client.php

示例7: Curl

- redefine $url to point to the location of this file, eg http://localhost/test.php
- run this script by browsing to it and appending a 'run' parameter to the url, eg http://localhost/test.php?run
*/
$url = 'http://localhost/~pandayak/curl/test.php';
if (isset($_GET['run'])) {
    require 'curl.php';
    $c = new Curl();
    //test default behavior
    $param = 'qwe';
    $test = $c->get($url, array('param' => $param));
    assert($param == $test);
    $param = 'asd';
    $test = $c->post($url, array('param' => $param));
    assert($param == $test);
    $param = 'zxc';
    $test = $c->put($url, array('param' => $param));
    assert($param == $test);
    $param = '123';
    $test = $c->delete($url, array('param' => $param));
    assert($param == $test);
    //test multi behavior w/ single requests
    $param = 'qwe';
    $test = $c->multi(array(array('get', $url, array('param' => $param))));
    assert($param == $test[0]);
    $param = 'asd';
    $test = $c->multi(array(array('post', $url, array('param' => $param))));
    assert($param == $test[0]);
    $param = 'zxc';
    $test = $c->multi(array(array('put', $url, array('param' => $param))));
    assert($param == $test[0]);
    $param = '123';
开发者ID:erikeldridge,项目名称:archive,代码行数:31,代码来源:test.php

示例8: Curl

<?php

require '../src/Curl.class.php';
// curl -X PUT -d "id=1&first_name=Zach&last_name=Borboa" "http://httpbin.org/put"
$curl = new Curl();
$curl->put('http://httpbin.org/put', array('id' => 1, 'first_name' => 'Zach', 'last_name' => 'Borboa'));
echo 'Data server received via PUT:' . "\n";
var_dump($curl->response->form);
开发者ID:canerdogan,项目名称:php-curl-class,代码行数:8,代码来源:put.php


注:本文中的Curl::put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。