Closed ali-asghar5 closed 2 months ago
@ali-asghar5
as completed successfully
Are you checking the ResponseMessage StatusCode? Or the ResponseMessage.IsSuccessStatusCode?
A 429 with the Stream APIs will still return a ResponseMessage (there are no exceptions, that's the whole point). You need to inspect the result.
Above is what I get
Right, that is not a success. The StatusCode is HTTP 400 (Bad Request). The Stream API is working as expected.
Stream APIs won't throw exceptions, it will return the raw response, your code should check if the response is a success or not if you have logic that depends on it.
Just like when you use the Typed-APIs, you try/catch and handle exceptions if that layer needs to.
Ah got it. How can I investigate BadRequest, response doesn't carry any message. I can successfully create items using CreateItemAsync just not with CreateItemStreamAsync using the same partition key.
Found the issue, I setting CosmosPropertyNamingPolicy.CamelCase for cosmos client SerializerOptions.
Hi mate, Thanks for the sample/ demo and tutorial.
If I use Is Stream APIs, it resulted as completed successfully but no data appear at database. If I switch it with CreateItemAsync then it works but I get Exception 429.
Have I missed anything...
Cheers