From cbca970ab761150809c20959dd057095bfbaff4e Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 18 Nov 2016 12:30:46 +0800 Subject: [PATCH] MDL-57035 repository_skydrive: Compability with converged type apps http://go.microsoft.com/fwlink/p/?LinkID=615760 --- repository/skydrive/microsoftliveapi.php | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/repository/skydrive/microsoftliveapi.php b/repository/skydrive/microsoftliveapi.php index 710777bdc67..9fe541a6cd6 100644 --- a/repository/skydrive/microsoftliveapi.php +++ b/repository/skydrive/microsoftliveapi.php @@ -60,18 +60,6 @@ class microsoft_skydrive extends oauth2_client { $this->foldernamecache = cache::make('repository_skydrive', 'foldername'); } - /** - * Should HTTP GET be used instead of POST? - * - * The Microsoft API does not support POST, so we should use - * GET instead (with the auth_token passed as a GET param). - * - * @return bool true if GET should be used - */ - protected function use_http_get() { - return true; - } - /** * Returns the auth url for OAuth 2.0 request * @return string the auth url @@ -88,6 +76,20 @@ class microsoft_skydrive extends oauth2_client { return 'https://login.live.com/oauth20_token.srf'; } + /** + * Post request. + * + * Overridden to convert the data to a string, else curl will set the wrong headers. + * + * @param string $url The URL. + * @param array|string $params The parameters. + * @param array $options The options. + * @return bool + */ + public function post($url, $params = '', $options = array()) { + return parent::post($url, format_postdata_for_curlcall($params), $options); + } + /** * Downloads a file to a file from skydrive using authenticated request *