c# - WebAPI not working in Fiddler -


i have created post webapi can call follows:

<script type="text/javascript">  var thedata = {     number: "7181112222",     username: "myusername",     password: "mypassword",     enable: "true", };  $.ajax({     type: "post",     cache: "false",     url: "http://www.######.com/someapi/api/settingsconfig",     data: thedata }).done(function (msg) {     alert(msg); }).error(function (msg) {     alert('fail'); });  </script> 

i alert of 'success' when run code.

when run code in fiddler...yipes!!

post http://www.######.com/someapi/api/settingsconfig number=6464482035&username=metheuser&password=9999&enable=true

404 error

why inconsistancy!

in javascript snippet you're posting json object, while in fiddler example it's x-www-form-urlencoded string.

have tried including content-type header request:

  • application/x-www-form-urlencoded , posting string
  • application/json , posting json object

what controller's method signature - hit method in second example @ or erroring out before that?

what 404 mean in context - 'number' not found / post data null ?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -