c# - Custom names when for FromUrl formatter -
before anything, let's @ example code
public class somerequest { [jsonproperty("_desc")] public string description {get;set;} [jsonproperty("_index")] public int startindex {get;set;} } . . . public httpresponsemessage get([fromuri] somerequest request) { ... }
alright on post methods, somerequest deserialized , used custom names (_index , _desc) way not names wanted make point. when using method, though, full name of property have used in uri because formatter fromuri used while post method jsonformatter used. i'm looking way use custom names formatter way did json in post method.
thanks, peyman mo
use urldecode
, urlencodeunicode
methods of httputility
class. read more here.
Comments
Post a Comment