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 stringapplication/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
Post a Comment