admin管理员组文章数量:1287867
I noticed that starting from ServiceStack version 8.6, it is no longer possible to use anonymous types when calling REST services (unless modifying AssemblyUtils.ValidateTypeName
).
Currently, I create anonymous objects and make the HTTP request. how can I handle this situation?
I noticed that starting from ServiceStack version 8.6, it is no longer possible to use anonymous types when calling REST services (unless modifying AssemblyUtils.ValidateTypeName
).
Currently, I create anonymous objects and make the HTTP request. how can I handle this situation?
Share Improve this question edited Feb 24 at 3:37 w4rcT asked Feb 22 at 19:01 w4rcTw4rcT 3422 silver badges13 bronze badges1 Answer
Reset to default 1The safest way of passing an arbitrary payload is to encode it in a string (e.g. JSON or Base64) and have the client deserialize the string into the preferred type.
You could also convert it into a Dictionary<string,object>
with Reflection Utils T.ToObjectDictionary()
extension method and converted back into a Type with map.FromObjectDictionary<T>()
extension method. This benefits from cleaner (unencoded) JSON, but using object
isn't supported in non .NET Add ServiceStack Reference languages, although neither was anonymous types.
本文标签: cServicestack v86 anonymous typeStack Overflow
版权声明:本文标题:c# - Servicestack v.8.6 anonymous type - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741329769a2372700.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论