Posts

Showing posts with the label http-post

Web api Post call from ajax fails

Web api Post call from ajax fails I have an web api wand I call it method in an ajax with POST method, sending the parameter as data . It gives me a 404 not found error. But when I pass the data in the query string , it works fine. Please help me fixing the matter and get it worked when calling the method with data in the body, not the query string. Note : The web application and Web-api are running on different ports Sending a concrete type object in query string also does not work and received to web api as null config <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type, contentType, data" /> <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /> </customHeaders> </httpProtocol> Controller public class RiskC...