If you're doing that so that the pdf is directly loaded to the client's browser: it doesn't work (I already tried. But if you manage to do so, I'd be interested to know and you may become my new god).
To answer directly to your question, PostJson is waiting for JSON objects (This is the Thingworx mechanism) and you send a file (blob).
It just cannot andle that type.
I don't necessarily have to show it in the client browser.
I want my service to fetch the PDF file from the external URL and store it using FileRepository thing.
Fetching PDF using the above said PostJSON is where I'm facing issues.
If I use PostBinary, I'm getting following error:
Wrapped java.lang.Exception: Unable To Convert From org.json.JSONArray to BLOB Cause: Unable To Convert From org.json.JSONArray to BLOB
If I had to use LoadBinary, how to send the JSON content to the 3rd party URL? Because the LoadBinary params doesn't contain "content" attribute.
Please let me know.