A
A
Artur2014-08-14 13:54:21
PHP
Artur, 2014-08-14 13:54:21

Why am I getting a 500 error when creating files in OneDrive via the REST API (PHP)?

Good afternoon.
I send a PUT request to OneDrive, in response I receive a 500 status code, in the response body: An error occurred while performing the action. Try again later.

$url = $this->buildUrl(
            '{folder_id}/files/{filename}?access_token={token}',
            array(
                'folder_id' => $folderId,
                'filename'  => $filename,
                'token'     => $this->getAccessToken(),
            )
        );

        $response = wp_remote_request($url, array(
            'body'    => $content,
            'method'  => 'PUT',
        ));

The code is inside WordPress, for requests I use the WordPress HTTP API.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Borisovich, 2014-08-14
@Alexufo

Invalid request presumably. Are you sure that you send everything you need without errors? Did you see the query output?

A
Artur, 2014-08-14
@kovalevsky

The fact of the matter is that I even sent a copy of the request from the documentation, the request comes, the answer comes, but the answer is always 500 and the description of the error An error occurred while performing the action. Try again later.

M
maratfmu, 2014-10-10
@maratfmu

Does POST work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question