Download Sharepoint Excel using the Rest Api

%3CLINGO-SUB%20id%3D%22lingo-sub-2162070%22%20slang%3D%22en-US%22%3EDownload%20Sharepoint%20Excel%20using%20the%20Rest%20Api%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162070%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWorking%20as%20a%20developer%20on%20iSeries%20(AS%2F400)%2C%20I%20use%20the%20Rest%20Api's%20to%20upload%2Fdownload%20documents%20to%2Ffrom%20Sharepoint.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20tool%20to%20Get%2FPost%20messages%20is%20Axis%20(C%2B%2B%20code).%3C%2FP%3E%3CP%3EC%20works%20with%20%22null%20terminated%22%20strings%20and%20this%20causes%20problems%20when%20downloading%20byte%20streams%20that%20contain%20hex(00)%20bytes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EIs%20there%20a%20way%20to%20tell%20the%20Rest%20Api%20to%20return%20the%20byte%20stream%20as%20a%20base64%20encoded%20stream%20(or%20as%20an%20ANSI%20byte%20stream)%20%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20tried%20some%20combinations%20of%20%22Accept-Charset%22%20%2F%20%22Accept-Encoding%22%2C%20but%20without%20succes%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anybody%26nbsp%3B%20know%20a%20solution%20for%20this%20problem%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor

 

Working as a developer on iSeries (AS/400), I use the Rest Api's to upload/download documents to/from Sharepoint.

 

The tool to Get/Post messages is Axis (C++ code).

C works with "null terminated" strings and this causes problems when downloading byte streams that contain hex(00) bytes.

 

Is there a way to tell the Rest Api to return the byte stream as a base64 encoded stream (or as an ANSI byte stream) ?

I tried some combinations of "Accept-Charset" / "Accept-Encoding", but without succes :(

 

Does anybody  know a solution for this problem ?

 

Kind regards

1 Reply
Haven’t looked into it but you’ve got Azure so why not build a proxy in between using an Azure Function?

You’ll be able to turn it to base64 from there.

Just a thought.