curl出现Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Pl
来源:互联网 发布:索尼xzp挂起网络 编辑:程序博客网 时间:2024/06/08 05:37
<pre name="code" class="php"><?phpclass IPTest extends PHPUnit_Framework_TestCase{public function testUpload01(){$file = __DIR__.'\assets\test.txt';$post['file'] = '@'.$file;//非 PHP5.5//$post['file'] = new CurlFile($file);//PHP 5.5 $ch = curl_init();curl_setopt($ch, CURLOPT_HEADER, false);//启用时会发送一个常规的POST请求,类型为:application/x-www-form-urlencoded,就像表单提交的一样。curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch,CURLOPT_BINARYTRANSFER,true);curl_setopt($ch, CURLOPT_POSTFIELDS,$post);curl_setopt($ch, CURLOPT_URL, $GLOBALS['UPLOAD_URL']);$info= curl_exec($ch);curl_close($ch); if(curl_error($ch)) { $this -> assertTrue(false); }$res = json_decode($info, true);$this->assertEquals($except,$res[0]);}}?>
0 0
- curl出现Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Pl
- ErrorException: curl_setopt(): The usage of the @filename API for file uploading is deprecated.
- The type Contacts is deprecated
- The type SmsMessage is deprecated
- The type SmsMessage is deprecated
- The type MultipartEntity is deprecated
- The type ActionBarActivity is deprecated
- The type SmsMessage is deprecated
- The "Android" command is deprecated.
- The "android" command is deprecated
- 解决The standalone version of hieararchyviewer is deprecated.
- 解决The standalone version of hieararchyviewer is deprecated
- 'getch': The POSIX name for this item is deprecated
- php报错:Deprecated: Assigning the return value of new by reference is deprecated in
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command
- windows定时执行kettle的job
- 北邮研究生2016年算法期末考试试题
- 进入推送!
- 模板匹配&&频域相位相关
- makefile 获取shell命令的结果
- curl出现Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Pl
- Android经典面试题总结(未完待续)
- Java通过SMS短信平台实现发短信功能
- C++并行编程——openMP
- Spring cache 缓存介绍
- 怎样将pdf转换成word文本文档
- C++连接Oracle之OCCI(windows)
- iOS frame与bounds区别详解
- 理解Android Framework