forked from github/cordova-android
Adding custom headers to upload
This commit is contained in:
parent
ee4c91539a
commit
044a61d881
@ -280,10 +280,10 @@ public class FileTransfer extends Plugin {
|
|||||||
// Handle the other headers
|
// Handle the other headers
|
||||||
try {
|
try {
|
||||||
JSONObject headers = params.getJSONObject("headers");
|
JSONObject headers = params.getJSONObject("headers");
|
||||||
for (Iterator iter = params.keys(); iter.hasNext();)
|
for (Iterator iter = headers.keys(); iter.hasNext();)
|
||||||
{
|
{
|
||||||
String headerKey = iter.next().toString();
|
String headerKey = iter.next().toString();
|
||||||
conn.setRequestProperty(headerKey, params.getString(headerKey));
|
conn.setRequestProperty(headerKey, headers.getString(headerKey));
|
||||||
}
|
}
|
||||||
} catch (JSONException e1) {
|
} catch (JSONException e1) {
|
||||||
// No headers to be manipulated!
|
// No headers to be manipulated!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user