Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -69,7 +70,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 73 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L73

Added line #L73 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, httpHeaders);
}
Expand Down Expand Up @@ -121,7 +122,7 @@
resourcePath = resourcePath + check getPathForQueryParam(queries);
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 125 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L125

Added line #L125 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, httpHeaders);
}
Expand All @@ -138,7 +139,7 @@
}
map<string|string[]> 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);
}
Expand All @@ -155,7 +156,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 159 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L159

Added line #L159 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, httpHeaders);
}
Expand All @@ -173,7 +174,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 177 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L177

Added line #L177 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, httpHeaders);
}
Expand Down Expand Up @@ -241,7 +242,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 245 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L245

Added line #L245 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->post(resourcePath, request, httpHeaders);
}
Expand Down Expand Up @@ -359,7 +360,7 @@
}
map<string|string[]> 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);
}
Expand Down Expand Up @@ -392,7 +393,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 396 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L396

Added line #L396 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->post(resourcePath, request, httpHeaders);
}
Expand Down Expand Up @@ -457,7 +458,7 @@
}
map<string|string[]> httpHeaders = http:getHeaderMap(headerValues);
http:Request request = new;
json jsonBody = payload.toJson();
json jsonBody = jsondata:toJson(payload);

Check warning on line 461 in ballerina/client.bal

View check run for this annotation

Codecov / codecov/patch

ballerina/client.bal#L461

Added line #L461 was not covered by tests
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, httpHeaders);
}
Expand Down
Loading