Open ArthurMa1978 opened 3 years ago
From @archerzz : As for whether the subsequent requests should be long running, the specification doesn't clearly define that. However, a reasonable assumption is that the subsequent requests should NOT be long running.
From @archerzz :
As for the HTTP methods for the next link, it should always be a HTTP Get according to the x-ms-pageable
specification:
Note: The request to get the nextPage will always be a GET request
However, there are exceptions. Some API uses the same HTTP method for subsequent requests. See: https://github.com/Azure/azure-rest-api-specs/issues/15136
Not high priority, ideally we need to do it for GA but also can post GA
Web RP has some operations that fall into this case.
The request path PR leaves a placeholder to implement this: https://github.com/Azure/autorest.csharp/blob/bbba45922308e94ecd5ca0d8f7035957a417e469/src/AutoRest.CSharp/Mgmt/Generation/MgmtClientBaseWriter.cs#L195
Handwrite before GA and auto-gen after GA
There are API definitions which define pagination in HTTP post.
Example See https://github.com/Azure/azure-rest-api-specs/blob/a2d4dc4b1296624eefd4b5c235d56af46f7c39d2/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/bastionHost.json#L266
We have: POST
/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks
"x-ms-long-running-operation": true "x-ms-pageable" POST/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks
"x-ms-pageable" POST/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions
"x-ms-long-running-operation": true "x-ms-pageable" POST/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions
"x-ms-pageable" Some open questions: Shall we use the same HTTP method for subsequent requests? If the 1st request is long running, shall we do the long running for subsequent requests?