[ClientRuntime] Added PATCH as a valid method when Created status is returned on LRO#3601
[ClientRuntime] Added PATCH as a valid method when Created status is returned on LRO#3601ScottHolden wants to merge 1 commit intoAzure:psSdkJson6from ScottHolden:azureRestPATCHCreatedResponse
Conversation
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
|
@ScottHolden, |
| var method = initialResponse.Request.Method; | ||
| if (statusCode == HttpStatusCode.OK || statusCode == HttpStatusCode.Accepted || | ||
| (statusCode == HttpStatusCode.Created && method == HttpMethod.Put) || | ||
| (statusCode == HttpStatusCode.Created && (method == HttpMethod.Put || method == new HttpMethod("PATCH"))) || |
There was a problem hiding this comment.
@ScottHolden this change is already put in for the next release for ClientRuntime and is being tracked by #3592
Just curious what scenarios that you have for which you need this fix?
Also all such contributions need test coverage, else the PR will be not be accepted.
There was a problem hiding this comment.
Hi @shahabhijeet , this change is required for the EventGrid client ( #3600 )
Did you want me to write up some tests for this, or should I close this ahead of Microsoft internally doing the work?
|
@ScottHolden this is no longer needed as a PR has been opened to fix this issue. |
Description
As per #3592 , PATCH long running operations return a 'Created' HTTP status code. This change adds this as a valid response.
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK.