robospice
robospice copied to clipboard
Download a file with query params
Hello,
I am looking for a way to download a file from server, I see two options, one of them is to use: BinaryRequest
but it works only if you pass the total path of the file, for example: "https://www.ietf.org/rfc/rfc2616.txt"
, and I need to send parameters to the server in this way: api/SomeServiceTranslationFile?Language=en"
, in that request I send the parameter "en" and RS responds with a Java.io.FileNotFoundException:
.
The other way is to make use of RetrofitSpiceRequest <InputStream, MyInterface>
, here I send my parameters like any other request, however, the response is treated to be parsed by GSON
An exception occurred during request network execution :Failed to invoke public java.io.InputStream() with no args retrofit.RetrofitError: Failed to invoke public java.io.InputStream() with no args
Have any suggestions?
Personally I'd create a custom request which connects through the Apache http client and saves the result somewhere.
On 6 May 2017 00:49:36 BST, Julio Lemus [email protected] wrote:
Hello,
I am looking for a way to download a file from server, I see two options, one of them is to use:
BinaryRequest
but it works only if you pass the total path of the file, for example:"https://www.ietf.org/rfc/rfc2616.txt"
, and I need to send parameters to the server in this way:api/SomeServiceTranslationFile?Language=en"
, in that request I send the parameter "en" and RS responds with aJava.io.FileNotFoundException:
.The other way is to make use of
RetrofitSpiceRequest <InputStream, MyInterface>
, here if I send my parameters like any other request, however, the response is treated to be parsed by GSONAn exception occurred during request network execution :Failed to invoke public java.io.InputStream() with no args retrofit.RetrofitError: Failed to invoke public java.io.InputStream() with no args
Have any suggestions?
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/stephanenicolas/robospice/issues/468
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.