Error while creating design document

Hi i am using curl to create design document . but i am getting below error

{“error”:“bad_request”,“reason”:“invalid UTF-8 JSON: {{error,{74,\n “lexical error: invalid character inside string.\n”}},\n <<”{\r\n \“views\” : {\r\n \“byloc\” : {\r\n \“map\” : \“function(doc,meta)\r\n{ emit(meta.id,null)\r\n\r\n}\” \r\n }\r\n }\r\n}">>}"}

and also i want to create view to existing design document. but rest api we have while creating design document ly we need to specify view. is there way we can create view to existing design document without altering existing view.

Hi, could you please give us the complete curl command you are using?
thanks

oh sorry, It was my miss. had forgotten the string literal in curl commands. now its working …anyway thanks