Per my test, you can use the following rest api to get the content of a file. But this api can only get the files in Shared Document.
http://mysite.sharepoint.com/<site_name>/_api/web/getfilebyserverrelativeurl('<url>)/$value?binaryStringResponseBody=true
For the files in other library I will recommend you to use graph api driveitem-get-content
GET /sites/{siteId}/drive/items/{item-id}/content
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.