Home > OS >  Unexpected character encountered while parsing value: <. Path '', line 0, position 0.&#
Unexpected character encountered while parsing value: <. Path '', line 0, position 0.&#

Time:07-12

This is my json parameter which I have checked..it is correct

 {
        "ticketID": "0",
        "consumerNo": "",
        "issueDescription": "amount is wrong",
        "isBill": "1",
        "billOrReceiptNumber": "13",
        "issueTypeFId": "1",
        "issueSubTypeFId": "1",
        "otherType": "",
        "otherSubtype": "",
        "billType": "1",
        "isRc": "0",
        "supportToConsumerDescription": "",
        "consumerToSupportDescription": "",
        "supportToRCdescription": "",
        "userFId": "",
        "newstatus": "0",
        "oldStatus": "0",
        "newAssignee": "",
        "oldAssignee": "",
        "isConsumerAsked": "0",
        "isConsumerReplied": "0",
        "fileuploads": "",
        "comment": "New Ticket Added",
        "secretKeys": "33MsbZsPaEKJkgLvfynAeiGMwhJzJ1Rfr9WUxwya9KYy5wyWz0fkbUblMF0fU3BC0KNObdPFLoQiNgKkSttZgO7bRbvoRfy1OJjVx9r 1DQ="
    }

But still it is throwing error..I am unable tofind solution please tell me where I am wrong

Here is my c# code for executing function

        DataTable retOg = new DataTable();
            var client = new RestClient(System.Configuration.ConfigurationManager.AppSettings["links"].ToString()   functionName);
            client.Timeout = -1;

            var request = new RestRequest(Method.POST);
            request.AddHeader("Content-Type", "application/json");
            request.AddParameter("application/json", param, ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);
            string res = response.Content;
            dynamic jsonResponse = JsonConvert.DeserializeObject(res);
          
            

Server response in res string

Server Error in '/' Application.
 Description: An unhandled exception occurred during the execution of
 the current web request. Please review the stack trace for more
 information about the error and where it originated in the code.
 
Exception Details: System.ArgumentException: Unknown web method
addEditTickets. Parameter name: methodName

CodePudding user response:

You're getting the JSON parsing exception because the server is returning a text response (which you've listed in your question).

Unknown web method addEditTickets. Parameter name: methodName

Based on the error, it seems that the URL you're trying to use is invalid. Verify that the URL you're constructing is valid; it appears that functionName does not contain the correct value in this expression:

System.Configuration.ConfigurationManager.AppSettings["links"].ToString()   functionName
  • Related