-
Notifications
You must be signed in to change notification settings - Fork 179
Enable $batch request with minimal API #1510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| /// </summary> | ||
| public class ODataMiniBatchMiddleware | ||
| { | ||
| internal const string MinimalApiMetadataKey = "MS_MinimalApiMetadataKey_386F76A4-5E7C-4B4D-8A20-261A23C3DD9A"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this key used for? Is it specific for minimal API?
Can I use another value other than the one you have provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's only for minimal API scenario only. It's a key to save the metadata into HttpContext.Items and retrieve it from the HttpContext is it's OData $batch request.
| request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json")); | ||
| HttpContent content = new StringContent(@" | ||
| { | ||
| ""requests"": [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add for methods POST and PATCH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$batch is only for POST request.
|
/AzurePipelines run |
|
No pipelines are associated with this pull request. |
Enable $batch request with minimal API