use of org.eclipse.jetty.client.api.ContentProvider in project camel by apache.
the class DefaultCompositeApiClient method submitCompositeBatch.
@Override
public void submitCompositeBatch(final SObjectBatch batch, final ResponseCallback<SObjectBatchResponse> callback) throws SalesforceException {
checkCompositeBatchVersion(version, batch.getVersion());
final String url = versionUrl() + "composite/batch";
final Request post = createRequest(HttpMethod.POST, url);
final ContentProvider content = serialize(batch, batch.objectTypes());
post.content(content);
doHttpRequest(post, (response, exception) -> callback.onResponse(tryToReadResponse(SObjectBatchResponse.class, response), exception));
}
Aggregations