Add handling of <string> parameters with HttpArgumentSource set to CONTENT

master
Harald Wolff 2023-08-07 12:36:43 +02:00
parent a0ca936554
commit 16f1b2cf06
1 changed files with 4 additions and 0 deletions

View File

@ -111,6 +111,10 @@ namespace ln.http
} else if (_parameterInfos[n].ParameterType.Equals(typeof(TextReader)))
{
parameters[n] = new StreamReader(requestContext.Request.ContentStream);
} else if (_parameterInfos[n].ParameterType.Equals(typeof(string)))
{
using (var r = new StreamReader(requestContext.Request.ContentStream))
parameters[n] = r.ReadToEnd();
} else if (requestContext.Request.Headers.TryGetValue("Content-Type", out string contentType) &&
contentType.Equals("application/json"))
{