Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android DownloadManager with POST method?


I started to work with android.app.DownloadManager and faced a problem.
By default, DM sending HTTP GET request to download file:

GET http://www.example.com/getfile HTTP/1.1
Cookie: id=sdfsdf;Max-Age=10800000;Path=/
Host: ___
Connection: Keep-Alive
User-Agent: AndroidDownloadManager Paros/3.2.13
Content-length: 0

But I need to send some data in request(e.g. json string)
Are there any ways to send HTTP POST request in DownloadManager

like image 736
Grekov Serg Avatar asked Jun 26 '12 17:06

Grekov Serg


1 Answers

While waiting for another more accurate answer :

I don't think you can add data to this request since, as you said it, it's a GET request and not POST.

Maybe this thread can give you a hint on another way to achieve what you want if the Download-Manager is not absolutely required : How do download a file with login using HttpURLConnection

like image 104
Darkendorf Avatar answered Oct 20 '22 09:10

Darkendorf