stephanenicolas / robospice

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k stars 545 forks source link

Download a file with query params #468

Open jclemus91 opened 7 years ago

jclemus91 commented 7 years ago

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?

softwaremaverick commented 7 years ago

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 notifications@github.com 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 a Java.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 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?

-- 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.