From 27a85953df4dd88f17ce016cad2fc7042de7c7c2 Mon Sep 17 00:00:00 2001 From: jamesmanningrapidscale <166409818+jamesmanningrapidscale@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:50:46 -0500 Subject: [PATCH] fix media type on empty request body --- src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid b/src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid index 52400fa632..a98425f078 100644 --- a/src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid +++ b/src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid @@ -286,7 +286,7 @@ request_.Content = content_; {% endif -%} {% elsif operation.IsGetOrDeleteOrHead == false -%} - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "{{ operation.Produces }}"); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "{{ operation.Consumes }}"); {% endif -%} {% endif -%} request_.Method = new System.Net.Http.HttpMethod("{{ operation.HttpMethodUpper | upcase }}");