亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將 Curl 命令轉換為 php 的 -i -t 選項

如何將 Curl 命令轉換為 php 的 -i -t 選項

PHP
MMTTMM 2023-07-30 13:07:52
我想將下面的curl命令轉換為php,我嘗試從https://incarnate.github.io/curl-to-php/進行轉換,但它沒有正確轉換。我如何<myobject>在 php 中設置curl?我沒有得到。有人能幫我嗎?curl -i -T <myobject> -X PUT -H "X-Auth-Token: <token>" <storage url>
查看完整描述

1 回答

?
ITMISS

TA貢獻1871條經驗 獲得超8個贊

看起來你想使用curl來上傳文件......

// initialise the curl request

$request = curl_init('http://example.com/');


// send a file

curl_setopt($request, CURLOPT_POST, true);

curl_setopt(

? ? $request,

? ? CURLOPT_POSTFIELDS,

? ? array(

? ? ? 'file' => '@' . realpath('example.txt')

? ? ));


// output the response

curl_setopt($request, CURLOPT_RETURNTRANSFER, true);

echo curl_exec($request);


// close the session

curl_close($request);


查看完整回答
反對 回復 2023-07-30
  • 1 回答
  • 0 關注
  • 129 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號