How to set rename in cURL by PHP
PHPからBOXAPIを使用し、BOX上のファイルをリネームする処理で困っております。
(I am having trouble with the process of renaming files on the BOX using the BOX API from PHP.)
$res=system('curl -i -X PUT "https://upload.box.com/api/2.0/files/<FileID>" -H "Authorization: Bearer '.$access_token.'" -H "Content-Type: application/json" -d \'{"name":"newname.log"}\'');
こちらを実行した所、 「HTTP/1.1 405 Method Not Allowed」が発生してしまいました。
(When I executed this, "HTTP / 1.1 405 Method Not Allowed" occurred.)
GETとPOSTのcurlは問題なく処理できるのですが、PUTが上手くいきません。
(GET and POST curl works fine, but PUT doesn't work.)
=========================================================== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 20 0 0 100 20 0 20 0:00:01 --:--:-- 0:00:01 38 HTTP/1.1 405 Method Not Allowed Date: Tue, 24 Aug 2021 05:02:35 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 0 Connection: keep-alive Allow: OPTIONS, POST, GET, HEAD Strict-Transport-Security: max-age=31536000 ===========================================================
対処法を教えてください。 よろしくお願いいたします。
(Please tell me how to deal with it.Thank you.)
Please sign in to leave a comment.
Comments
0 comments