c# - get 400 bad request in a simple rest api get method -


i have in customercontroller.cs

[httpget] [actionname("getcustomernames")] [route("api/accounts/mydept/customer/getcustomernames", name = "get_customernames")] public httpresponsemessage getcustomernames() { 

...}

in register.cs have

        public static void register(httpconfiguration config, iunitycontainer container) {             config.routes.maphttproute(                   name: "get_customernames",                   routetemplate: "api/accounts/mydept/{controller}/{action}",                   defaults: null,                   constraints: null,                   handler: defaulthandlers); } 

in fiddler, use http://localhost:5426/api/accounts/mydept/customer/getcustomernames

i 400 bad request.

i must have missed something. please let me know.


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -