I am working on Azure Cosmos DB with SQL Api. I am using Azure SDK from:
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-documentdb</artifactId>
<version>2.4.7</version>
</dependency>
in order to insert items into collection.
DocumentClient documentClient = setupDocumentClient();
ResourceResponse<Document> document = documentClient.createDocument("/dbs/" + databaseName + "/colls/" + colName, entity, new RequestOptions(), true);
I am getting an exception:
com.microsoft.azure.documentdb.DocumentClientException: Message: {"Errors":["Date header doesn't conform to the required format. Please ensure that the time is provided in GMT and conforms to RFC 1123 date-time specifications.","Date header doesn't conform to the required format. Please ensure that the time is provided in GMT and conforms to RFC 1123 date-time specifications."]}
What is weird, is that I was using the same code in another project and it was working without this exception and the data was inserted correctly to the Azure Cosmos DB. Maybe someone has encounter this problem and found solution for it?