Skip to content

Commit 85ddde3

Browse files
author
Danny Tundwe (from Dev Box)
committed
Fix: Add Content-Type header to get-version-code command
- Added Content-Type: application/json header to POST request - Expanded Accept header to include text/plain and */* for better compatibility - Resolves 'Unsupported Media Type' error when calling get-version-code - Added test case for get-version-code command The fix ensures proper HTTP headers are sent for the getVersionCode operation, which is a POST request with no body. Some Azure services require both Content-Type and Accept headers to be present even for empty-body requests.
1 parent 2a0caa4 commit 85ddde3

3 files changed

Lines changed: 967 additions & 1 deletion

File tree

src/edge-action/azext_edge_action/aaz/latest/edge_action/version/_get_version_code.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ def query_parameters(self):
165165
def header_parameters(self):
166166
parameters = {
167167
**self.serialize_header_param(
168-
"Accept", "application/json",
168+
"Content-Type", "application/json",
169+
),
170+
**self.serialize_header_param(
171+
"Accept", "application/json, text/plain, */*",
169172
),
170173
}
171174
return parameters

0 commit comments

Comments
 (0)