c# - how to pass parameters to asp.net web api get method? -
following method in asp.net web api.
[httpget] public ihttpactionresult getdetails([frombody] retrievedetails edetails) {} following class
public class retrievedetails { public string name{ get; set; } public string type { get; set; } } when try call getdetails fiddler edetails null.
http://localhost:101222/api/emailservice/getdetails?name=testname&type=testtype
i tried different methods value null. if change [httpget] [httppost] , add request body working fine. need method.
do need [frombody] there if passing values in url get. should using [fromuri] if passing values in querystring.
Comments
Post a Comment