You are here

private function BackupMigrateDropboxAPI::is_json_response in Backup and Migrate Dropbox 7.3

Returns whether the response should be a json string or file contents.

  • 'api' endpoints always return json.
  • 'content' endpoints may return:
    • File contents (files/download).
    • A json encoded object.
    • Nothing (files/upload_session/append_v2).

Parameters

string $endpointType:

string $command:

Return value

bool True if the response is expected to be a json string, false otherwise.

1 call to BackupMigrateDropboxAPI::is_json_response()
BackupMigrateDropboxAPI::send_message in ./backup_migrate_dropbox.dropbox_api.inc
Sends a request to Dropbox and returns the response.

File

./backup_migrate_dropbox.dropbox_api.inc, line 773

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

private function is_json_response($endpointType, $command) {
  return $endpointType === 'api' || !in_array($command, [
    'files/download',
    'files/upload_session/append_v2',
  ]);
}