diff --git a/ballerina/client.bal b/ballerina/client.bal index 1c61b30..8f9a4ef 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -17,6 +17,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/data.jsondata; import ballerina/http; public isolated client class Client { @@ -52,7 +53,7 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -102,7 +103,7 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->patch(resourcePath, request, httpHeaders); } @@ -119,7 +120,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -136,7 +137,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -153,7 +154,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -170,7 +171,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -204,7 +205,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -221,7 +222,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -236,7 +237,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); }