@@ -360,9 +360,13 @@ def _create_change_owner_serialize(
360360 )
361361
362362 # set the HTTP header `Content-Type`
363+ # Only emit Content-Type when there's actually a body/form/file to send.
364+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
365+ # application/json ("malformed JSON string"); other Proxmox products are
366+ # equally fussy. An explicit `_content_type` override always wins.
363367 if _content_type :
364368 _header_params ['Content-Type' ] = _content_type
365- else :
369+ elif _body_params is not None or _form_params or _files :
366370 _default_content_type = (
367371 self .api_client .select_header_content_type (
368372 [
@@ -1241,9 +1245,13 @@ def _create_move_group_serialize(
12411245 )
12421246
12431247 # set the HTTP header `Content-Type`
1248+ # Only emit Content-Type when there's actually a body/form/file to send.
1249+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1250+ # application/json ("malformed JSON string"); other Proxmox products are
1251+ # equally fussy. An explicit `_content_type` override always wins.
12441252 if _content_type :
12451253 _header_params ['Content-Type' ] = _content_type
1246- else :
1254+ elif _body_params is not None or _form_params or _files :
12471255 _default_content_type = (
12481256 self .api_client .select_header_content_type (
12491257 [
@@ -1554,9 +1562,13 @@ def _create_move_namespace_serialize(
15541562 )
15551563
15561564 # set the HTTP header `Content-Type`
1565+ # Only emit Content-Type when there's actually a body/form/file to send.
1566+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1567+ # application/json ("malformed JSON string"); other Proxmox products are
1568+ # equally fussy. An explicit `_content_type` override always wins.
15571569 if _content_type :
15581570 _header_params ['Content-Type' ] = _content_type
1559- else :
1571+ elif _body_params is not None or _form_params or _files :
15601572 _default_content_type = (
15611573 self .api_client .select_header_content_type (
15621574 [
@@ -1867,9 +1879,13 @@ def _create_namespace_serialize(
18671879 )
18681880
18691881 # set the HTTP header `Content-Type`
1882+ # Only emit Content-Type when there's actually a body/form/file to send.
1883+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1884+ # application/json ("malformed JSON string"); other Proxmox products are
1885+ # equally fussy. An explicit `_content_type` override always wins.
18701886 if _content_type :
18711887 _header_params ['Content-Type' ] = _content_type
1872- else :
1888+ elif _body_params is not None or _form_params or _files :
18731889 _default_content_type = (
18741890 self .api_client .select_header_content_type (
18751891 [
@@ -2180,9 +2196,13 @@ def _create_prune_serialize(
21802196 )
21812197
21822198 # set the HTTP header `Content-Type`
2199+ # Only emit Content-Type when there's actually a body/form/file to send.
2200+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
2201+ # application/json ("malformed JSON string"); other Proxmox products are
2202+ # equally fussy. An explicit `_content_type` override always wins.
21832203 if _content_type :
21842204 _header_params ['Content-Type' ] = _content_type
2185- else :
2205+ elif _body_params is not None or _form_params or _files :
21862206 _default_content_type = (
21872207 self .api_client .select_header_content_type (
21882208 [
@@ -2493,9 +2513,13 @@ def _create_prune_datastore_serialize(
24932513 )
24942514
24952515 # set the HTTP header `Content-Type`
2516+ # Only emit Content-Type when there's actually a body/form/file to send.
2517+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
2518+ # application/json ("malformed JSON string"); other Proxmox products are
2519+ # equally fussy. An explicit `_content_type` override always wins.
24962520 if _content_type :
24972521 _header_params ['Content-Type' ] = _content_type
2498- else :
2522+ elif _body_params is not None or _form_params or _files :
24992523 _default_content_type = (
25002524 self .api_client .select_header_content_type (
25012525 [
@@ -3090,9 +3114,13 @@ def _create_upload_backup_log_serialize(
30903114 )
30913115
30923116 # set the HTTP header `Content-Type`
3117+ # Only emit Content-Type when there's actually a body/form/file to send.
3118+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
3119+ # application/json ("malformed JSON string"); other Proxmox products are
3120+ # equally fussy. An explicit `_content_type` override always wins.
30933121 if _content_type :
30943122 _header_params ['Content-Type' ] = _content_type
3095- else :
3123+ elif _body_params is not None or _form_params or _files :
30963124 _default_content_type = (
30973125 self .api_client .select_header_content_type (
30983126 [
@@ -3403,9 +3431,13 @@ def _create_verify_serialize(
34033431 )
34043432
34053433 # set the HTTP header `Content-Type`
3434+ # Only emit Content-Type when there's actually a body/form/file to send.
3435+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
3436+ # application/json ("malformed JSON string"); other Proxmox products are
3437+ # equally fussy. An explicit `_content_type` override always wins.
34063438 if _content_type :
34073439 _header_params ['Content-Type' ] = _content_type
3408- else :
3440+ elif _body_params is not None or _form_params or _files :
34093441 _default_content_type = (
34103442 self .api_client .select_header_content_type (
34113443 [
@@ -10367,9 +10399,13 @@ def _update_group_notes_serialize(
1036710399 )
1036810400
1036910401 # set the HTTP header `Content-Type`
10402+ # Only emit Content-Type when there's actually a body/form/file to send.
10403+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
10404+ # application/json ("malformed JSON string"); other Proxmox products are
10405+ # equally fussy. An explicit `_content_type` override always wins.
1037010406 if _content_type :
1037110407 _header_params ['Content-Type' ] = _content_type
10372- else :
10408+ elif _body_params is not None or _form_params or _files :
1037310409 _default_content_type = (
1037410410 self .api_client .select_header_content_type (
1037510411 [
@@ -10680,9 +10716,13 @@ def _update_notes_serialize(
1068010716 )
1068110717
1068210718 # set the HTTP header `Content-Type`
10719+ # Only emit Content-Type when there's actually a body/form/file to send.
10720+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
10721+ # application/json ("malformed JSON string"); other Proxmox products are
10722+ # equally fussy. An explicit `_content_type` override always wins.
1068310723 if _content_type :
1068410724 _header_params ['Content-Type' ] = _content_type
10685- else :
10725+ elif _body_params is not None or _form_params or _files :
1068610726 _default_content_type = (
1068710727 self .api_client .select_header_content_type (
1068810728 [
@@ -10993,9 +11033,13 @@ def _update_protected_serialize(
1099311033 )
1099411034
1099511035 # set the HTTP header `Content-Type`
11036+ # Only emit Content-Type when there's actually a body/form/file to send.
11037+ # PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
11038+ # application/json ("malformed JSON string"); other Proxmox products are
11039+ # equally fussy. An explicit `_content_type` override always wins.
1099611040 if _content_type :
1099711041 _header_params ['Content-Type' ] = _content_type
10998- else :
11042+ elif _body_params is not None or _form_params or _files :
1099911043 _default_content_type = (
1100011044 self .api_client .select_header_content_type (
1100111045 [
0 commit comments