Answer the question
In order to leave comments, you need to log in
Need help with rest api for cloud mail.ru?
I use the Cloud Mail.ru service for storing files.
After reading a rather meager help on how to form a REST API, I was left with a few questions.
Maybe someone already had experience with REST for mail.ru and he successfully mastered it? After contacting the support service, the question of generating the Authorization
key is still open . But from generally accepted standards, I form it as EMAIL and PASSWORD (through a colon).
In a task, I need to delete a file from a bucket using the DELETE command.
With the example below. i get an AccessDenied message.
$url = 'https://BACKET_NAME.hb.bizmrg.com/file.zip';
$date = date(DATE_RFC822);
$array = array
(
'Host'=>'BACKET_NAME.hb.bizmrg.com',
'Date'=>$date,
'Connection'=>'close',
'Content-Length'=>'length',
'Authorization'=>'EMAIL:PASSWORD',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $array);
echo curl_exec($ch);
Answer the question
In order to leave comments, you need to log in
the question of generating the Authorization key remained open. But from generally accepted standards, I form it as EMAIL and PASSWORD (through a colon)
Mail cloud storage provides a protocol that is fully compatible with the S3 API.
To work, you can use any S3 client https://mcs.mail.ru/help/sdk/php?kb_language=ru_RU
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question