been banging my head against the wall with this one.
Need to POST to a RESTful web service. Username goes in the request url. Password goes in the request body. Content-type must be application/x-www-form-urlencoded.
Using the Chrome "Simple REST Client" extension, everything is working fine.
Using jQuery.AJAX(), I continually get a 405 (Method Not Allowed) error.
Okay, here's the code:
$.ajax({ type: "POST", contentType: "application/x-www-form-urlencoded", url: baseURL + "api/users/" + username + "/login", data: { password: password }, success: function(data) { console.log("success ", data.response); }, error: function(data) { console.log("error ", data.error); }, dataType: "jsonp" });
Does anyone see anything that is wrong with the code?
Thanks, Jacob