Giter VIP home page Giter VIP logo

Comments (7)

kevinsawicki avatar kevinsawicki commented on May 22, 2024

I'm not sure this code make sense:

params.put("playlist[vid][]", "123");
params.put("playlist[vid][]", "456");

This would seem to override the "123" value inserted with "456" since you are using the same key for both ("playlist[vid][]").

from http-request.

kevinsawicki avatar kevinsawicki commented on May 22, 2024

For example number 2 have you tried:

File upload = new File(Environment.getExternalStorageDirectory() + "/testupload/up.mp4");
req.part("content[name]", upload, null, "video/mp4");

using this api.

from http-request.

davidbilly avatar davidbilly commented on May 22, 2024

Hi kevinsawicki,

is that ,
Map params = new HashMap();
params.put("playlist[name]", "testNewPlaylist");
params.put("playlist[vid][]", "123");
params.put("playlist[vid][]", "456");

equals to this?
List nameValuePairs = new ArrayList();
nameValuePairs.add(new BasicNameValuePair("devices[]", device1));
nameValuePairs.add(new BasicNameValuePair("devices[]", device2));
nameValuePairs.add(new BasicNameValuePair("devices[]", device3));

This method it works! req.part("content[name]", "up.mp4", "video/mp4", upload);

i had faced some issue, that is how to i get the progress % for downloading/uploding, because i want to let user know how many % been progress.

Now i do this for download,
while ((count = input.read(data)) != -1) {
if (isQuitting()) { input.close(); rav.close(); return cancelled().add("result", "downlaod canceled"); }
total += count;
rav.write(data, 0, count);
if ((fileLength + downloadFile.length()) > 0) updateProgress((int) ((total + downloadFile.length()) * 100 / (fileLength + downloadFile.length())));
}
There is any method to get progress of upload and download, that i can reduce my codes.

Sorry for many questions.

Really big thanks to you, it great helps to me.

from http-request.

kevinsawicki avatar kevinsawicki commented on May 22, 2024

Progress should be merged in soon and will be in the next release, #47

from http-request.

davidbilly avatar davidbilly commented on May 22, 2024

Hi kevinsawicki,

Sure, i'll wait for next release , big thanks to you and this lib 👍

from http-request.

kevinsawicki avatar kevinsawicki commented on May 22, 2024

Okay, I'm going to close this issue out then since it seems like all the questions were answered, please open a new issue if you have any problems or other questions.

from http-request.

davidbilly avatar davidbilly commented on May 22, 2024

Sure no problem! thanks kevinsawicki. 👍

from http-request.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.