Json : Unexpected character encountered while parsing value: s. Path '', line 0, position 0

asp.net c# entity entity-framework json

Question

This Code;

public void ProcessRequest(HttpContext context)
{
    string jSon = new StreamReader(context.Request.InputStream).ReadToEnd();
    string result = LETSGO.BUSINESS.Process.ApiProcesRequest(jSon);        
    context.Response.ContentType = "application/json";
    context.Response.Write(result);
}

Error : Unexpected character encountered while parsing value: s. Path '', line 0, position 0.

How do I fix error ?

This function send;

public static string ApiProcesRequest(string request)
    {
        Result result = new Result();
        try
        {
            var req = JsonConvert.DeserializeObject<Request>(request);
            switch (req.RequestType)
            {
                #region 1002 - Kullanıcı şifre hatırlatma
                case "1002":
                    result = UserProcess.PasswordReminder(request);
                    return JsonConvert.SerializeObject(result);
                    break;
                #endregion } } }
1
1
6/25/2014 12:34:29 PM

Popular Answer

string jSon = new StreamReader(context.Request.InputStream).ReadToEnd();

Here you might got the string like s.Path, it can not be deserialize due to it's not a well-formed json object.

2
6/25/2014 2:57:44 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow