Description
The string-returning method family uses inconsistent names depending on the HTTP verb:
| Verb |
Method name |
| GET |
GetAsStringAsync |
| POST |
PostAndGetResponseAsStringAsync |
| PUT |
PutAndGetResponseAsStringAsync |
| PATCH |
PatchAndGetResponseAsStringAsync |
| DELETE |
DeleteAndGetResponseAsStringAsync |
GET uses a shorter, cleaner convention; the other four use a verbose AndGetResponseAsString infix. This creates an inconsistent API surface that surprises callers switching between verbs.
Proposed Fix
Adopt one convention for all verbs. The GET style is more idiomatic:
| Old name |
New name |
PostAndGetResponseAsStringAsync |
PostAsStringAsync |
PutAndGetResponseAsStringAsync |
PutAsStringAsync |
PatchAndGetResponseAsStringAsync |
PatchAsStringAsync |
DeleteAndGetResponseAsStringAsync |
DeleteAsStringAsync |
Keep the old names as [Obsolete]-decorated overloads for one version cycle to avoid a hard breaking change, then remove them in the next major version.
Acceptance Criteria
Description
The string-returning method family uses inconsistent names depending on the HTTP verb:
GetAsStringAsyncPostAndGetResponseAsStringAsyncPutAndGetResponseAsStringAsyncPatchAndGetResponseAsStringAsyncDeleteAndGetResponseAsStringAsyncGET uses a shorter, cleaner convention; the other four use a verbose
AndGetResponseAsStringinfix. This creates an inconsistent API surface that surprises callers switching between verbs.Proposed Fix
Adopt one convention for all verbs. The GET style is more idiomatic:
PostAndGetResponseAsStringAsyncPostAsStringAsyncPutAndGetResponseAsStringAsyncPutAsStringAsyncPatchAndGetResponseAsStringAsyncPatchAsStringAsyncDeleteAndGetResponseAsStringAsyncDeleteAsStringAsyncKeep the old names as
[Obsolete]-decorated overloads for one version cycle to avoid a hard breaking change, then remove them in the next major version.Acceptance Criteria
{Verb}AsStringAsyncpattern[Obsolete]with a message pointing to the new name