diff options
Diffstat (limited to 'net/sync/gpoddernet')
3 files changed, 7 insertions, 7 deletions
diff --git a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java index da23cd351..cfa915ffa 100644 --- a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java +++ b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java @@ -157,7 +157,7 @@ public class GpodnetService implements ISyncService { } else { content = ""; } - RequestBody body = RequestBody.create(JSON, content); + RequestBody body = RequestBody.create(content, JSON); Request.Builder request = new Request.Builder().post(body).url(url); executeRequest(request); } catch (JSONException | MalformedURLException | URISyntaxException e) { @@ -190,7 +190,7 @@ public class GpodnetService implements ISyncService { requestObject.put("add", new JSONArray(added)); requestObject.put("remove", new JSONArray(removed)); - RequestBody body = RequestBody.create(JSON, requestObject.toString()); + RequestBody body = RequestBody.create(requestObject.toString(), JSON); Request.Builder request = new Request.Builder().post(body).url(url); final String response = executeRequest(request); @@ -272,7 +272,7 @@ public class GpodnetService implements ISyncService { } } - RequestBody body = RequestBody.create(JSON, list.toString()); + RequestBody body = RequestBody.create(list.toString(), JSON); Request.Builder request = new Request.Builder().post(body).url(url); final String response = executeRequest(request); @@ -330,7 +330,7 @@ public class GpodnetService implements ISyncService { e.printStackTrace(); throw new GpodnetServiceException(e); } - RequestBody requestBody = RequestBody.create(TEXT, ""); + RequestBody requestBody = RequestBody.create("", TEXT); Request request = new Request.Builder().url(url).post(requestBody).build(); try { String credential = Credentials.basic(username, password, Charset.forName("UTF-8")); diff --git a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudLoginFlow.java b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudLoginFlow.java index 3d2374acf..254be269f 100644 --- a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudLoginFlow.java +++ b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudLoginFlow.java @@ -117,7 +117,7 @@ public class NextcloudLoginFlow { private JSONObject doRequest(URL url, String bodyContent) throws IOException, JSONException { RequestBody requestBody = RequestBody.create( - MediaType.get("application/x-www-form-urlencoded"), bodyContent); + bodyContent, MediaType.get("application/x-www-form-urlencoded")); Request request = new Request.Builder().url(url).method("POST", requestBody).build(); Response response = httpClient.newCall(request).execute(); if (response.code() != 200) { diff --git a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudSyncService.java b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudSyncService.java index 67b4ddab0..eaee76baf 100644 --- a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudSyncService.java +++ b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/nextcloud/NextcloudSyncService.java @@ -71,7 +71,7 @@ public class NextcloudSyncService implements ISyncService { requestObject.put("add", new JSONArray(addedFeeds)); requestObject.put("remove", new JSONArray(removedFeeds)); RequestBody requestBody = RequestBody.create( - MediaType.get("application/json"), requestObject.toString()); + requestObject.toString(), MediaType.get("application/json")); performRequest(url, "POST", requestBody); } catch (Exception e) { e.printStackTrace(); @@ -121,7 +121,7 @@ public class NextcloudSyncService implements ISyncService { } HttpUrl.Builder url = makeUrl("/index.php/apps/gpoddersync/episode_action/create"); RequestBody requestBody = RequestBody.create( - MediaType.get("application/json"), list.toString()); + list.toString(), MediaType.get("application/json")); performRequest(url, "POST", requestBody); } catch (Exception e) { e.printStackTrace(); |