rbv_api.sendJSONRequest / Content-type

Posted by smartsysISV on 18-Nov-2014 03:50

if I use  "rbv_api.sendJSONRequest(url, null, "GET", contentType, username, password, headers)" to download a pdf- file, the top of the responsebody(file) looks like:

%PDF-1.4
%�����
1 0 obj

This is similar to filedate when using "rbv_api.getTextData"

I want to download the pdf as a binary-file, similar to "rbv_api.getBinaryData"
I have tried with a lots of content-types in the JSO Request but I do not get any changes in the response.

Can someone tell me wich content-type I should use?



All Replies

Posted by Gian Torralba on 18-Nov-2014 09:10
Hello,

What content type did you already use? Did you try using "application/pdf" as the content type?

Thank you,
Gian
Posted by smartsysISV on 18-Nov-2014 11:37

Yes, I have tried this.

Posted by Gian Torralba on 18-Nov-2014 13:20
Hello,

Are you accessing a public URL? Can you provide this for testing? Did you also add any HTTP header parameters to the API like header('Content-Transfer-Encoding: binary') but in a name/value format?

Thank you,
Gian
Posted by smartsysISV on 25-Nov-2014 08:42

This is an "Public" URL but I need to show you a private bearer as a  part of the header.

I can send this direct to you for testing. (Where can I send it?)

And yes, I add http headers for content-type (application/pdf).

Posted by smartsysISV on 25-Nov-2014 08:49

Here is the answer from Egnyte (Where I download from):

"

The Content-Type header is not your issue.

It looks like you are getting the binary content of the file but that it is being output to standard I/O.  If you are using a curl command, try adding the -O flag.

For example:

curl -O -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxx" 'smartsys.egnyte.com/.../FAKT-701906.pdf&

"

Posted by Orchid Corpin on 27-Nov-2014 09:30
Hi Stein,

Let me communicate this to the team whether it is possible to get the binary of the file using rbv_api.sendJSONRequest(), and will try to get alternative way.

Regards,
Orchid
Posted by Orchid Corpin on 27-Nov-2014 09:42
Hi Stein,

Can you send me the test URL for testing through my email: ocorpin@progress.com

Thanks,
Orchid
Posted by Daniel Figucio on 27-Jun-2015 01:24

Was there ever a response to this?

Posted by smartsysISV on 27-Jun-2015 03:19
This thread is closed