Json parsing error syntax error unexpected end of input

Json parsing error syntax error unexpected end of input

Asked on November 19, 2018 in knockout js.
Add Comment


  • 3 Answer(s)

       Try the Node http request and obey to the data event.

       Data event only keep the data into a buffer temporarily, and so a complete JSON  available is difficult. To solve this dataevent must be appended to a variable. Have a glance at (http://nodejs.org/api/http.html).

    Answered on November 19, 2018.
    Add Comment

    Try this simple code:

    data: '{"Name":"AA"}'
    
    
    Answered on November 19, 2018.
    Add Comment

    This code will solve all the problem:

    var data = JSON.parse(Buffer.concat(arr).toString());
    
    
    Answered on November 19, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.