@@ -27,16 +27,8 @@ import java.security.cert.X509Certificate;
2727import java.text.DateFormat;
2828import java.text.ParseException;
2929import java.text.SimpleDateFormat;
30- import java.util.ArrayList;
31- import java.util.Collection;
32- import java.util.Collections;
33- import java.util.Date;
34- import java.util.HashMap;
35- import java.util.List;
36- import java.util.Map;
30+ import java.util.*;
3731import java.util.Map.Entry;
38- import java.util.Properties;
39- import java.util.TimeZone;
4032import java.util.concurrent.TimeUnit;
4133import java.util.regex.Matcher;
4234import java.util.regex.Pattern;
@@ -1393,7 +1385,15 @@ public class ApiClient {
13931385
13941386 Authorization authorization = new Authorization();
13951387
1396- String requestBody = json.serialize(body);
1388+ String requestBody = null;
1389+ if ((method.equalsIgnoreCase("POST") || method.equalsIgnoreCase("PUT") ||
1390+ method.equalsIgnoreCase("PATCH"))
1391+ && body.equals("{ } ")) {
1392+ requestBody = " {}" ;
1393+ } else {
1394+ requestBody = json.serialize(body);
1395+ }
1396+
13971397 logger.debug("HTTP Request Body:\n" + requestBody);
13981398 merchantConfig.setRequestData(requestBody);
13991399 authorization.setJWTRequestBody(requestBody);
@@ -1489,7 +1489,11 @@ public class ApiClient {
14891489 reqBody = RequestBody.create(MediaType.parse(contentType), " " );
14901490 }
14911491 } else {
1492- reqBody = serialize(body, contentType);
1492+ if (body.equals(" {}" )) {
1493+ reqBody = RequestBody.create(" {}" , MediaType.parse(contentType));
1494+ } else {
1495+ reqBody = serialize(body, contentType);
1496+ }
14931497 }
14941498
14951499 Request request = null;
0 commit comments