diff options
author | Taco <SkytkRSfan3895@gmail.com> | 2024-03-10 01:55:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 07:55:35 +0100 |
commit | f1fe1b573f71cd8d2d5285ac811884da484d982a (patch) | |
tree | 48aefd727481884da9df5086b41a0dc0307f671a /net/sync/gpoddernet | |
parent | 48e8197e3f30e22a05e310fdaa1c662da670318d (diff) | |
download | AntennaPod-f1fe1b573f71cd8d2d5285ac811884da484d982a.zip |
Fix OkHttp deprecations (#6979)
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(); |