Skip to content

Commit 0b581af

Browse files
authored
fix: set RestRequest flag to force multipart/form-data when given as Content-Type
1 parent 74044c3 commit 0b581af

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,14 @@ namespace {{packageName}}.Client
384384
}
385385
}
386386
387+
if (options.HeaderParameters != null)
388+
{
389+
if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
390+
{
391+
request.AlwaysMultipartFormData = true;
392+
}
393+
}
394+
387395
return request;
388396
}
389397

0 commit comments

Comments
 (0)