I have a strange issue using IhttpClientFactory named client.
The "POST" body parameter are changing it's case to camel "initCap". I have written some Handlers (delegate handler) for adding "http headers", "exception handling" and "audit logging".
The parameters are changing the case to camelcase.
我的模特类
public class PostRequest
{
[DataMember(Name = "Request", EmitDefaultValue = false)]
public Request? Request { get; set; }
}
我知道这个属性是用于Newtonsof json的,但也try 了JsonProperty,但没有工作. .....
为了获得post调用的响应(在一个通用的calss方法中,
var httpContent = await client.PostAsJsonAsync(resource, requestBody, cancellationToken);
return await httpContent.Content.ReadFromJsonAsync<T>(cancellationToken: cancellationToken);
有没有人遇到过类似的问题?