ASP.NET 4.5.2 why my code is not accepting x-www-form-urlencoded

23 Views Asked by At
 [System.Web.Services.WebMethod, ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
    public string TransactionUpdate(string type, string resource, string number_of_attempts, string data)
    {
        string res = "";

        try
        {
            ActivityLog al = new ActivityLog();

            al.LogEvent("0", resource, data, "portal");

            res = "Success!";
        }
        catch (Exception ex)
        {
            res = "Error!";
        }

        return res;
    } 

Why this code is not working for URL encoded? While testing in Postman showing 404 error, but the same is working for JSON format. I want this should accept URL encoded. Do I have to make changes in webconfig file?

0

There are 0 best solutions below