Skip to content

Commit cf0ea09

Browse files
committed
downgrade oktthp to latest 3.12 version, fixes #144
* downgrading to 3.12, which is binary compatible with 4.X, makes sure mailjet is maximally compatible in case a project pulls in mailjet while already having okhttp 3.x on the classpath (as is the case with spring). Because it is binary compatible, people who have 4.X on the classpath should nevertheless be able to use this version.
1 parent 723889f commit cf0ea09

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<dependency>
5858
<groupId>com.squareup.okhttp3</groupId>
5959
<artifactId>okhttp</artifactId>
60-
<version>4.9.0</version>
60+
<version>3.12.0</version>
6161
</dependency>
6262
<dependency>
6363
<groupId>org.json</groupId>
@@ -86,7 +86,7 @@
8686
<dependency>
8787
<groupId>com.squareup.okhttp3</groupId>
8888
<artifactId>mockwebserver</artifactId>
89-
<version>4.9.0</version>
89+
<version>3.12.0</version>
9090
<scope>test</scope>
9191
</dependency>
9292

src/main/java/com/mailjet/client/MailjetClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public MailjetResponse post(MailjetRequest request) throws MailjetException {
108108

109109
try {
110110
final RequestBody requestBody = RequestBody.create(
111-
request.getBody().getBytes("UTF8"), MediaType.parse(request.getContentType()));
111+
MediaType.parse(request.getContentType()), request.getBody().getBytes("UTF8"));
112112

113113
final Request okHttpRequest = getPreconfiguredRequestBuilder(request)
114114
.post(requestBody)
@@ -132,7 +132,7 @@ public MailjetResponse post(MailjetRequest request) throws MailjetException {
132132
public MailjetResponse put(MailjetRequest request) throws MailjetException {
133133
try {
134134
final RequestBody requestBody = RequestBody.create(
135-
request.getBody().getBytes("UTF8"), MediaType.parse(request.getContentType()));
135+
MediaType.parse(request.getContentType()), request.getBody().getBytes("UTF8"));
136136

137137
final Request okHttpRequest = getPreconfiguredRequestBuilder(request)
138138
.put(requestBody)

0 commit comments

Comments
 (0)