incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Melo <andrew.m...@gmail.com>
Subject Re: AW: Re: AW: Re: {"error":"bad_request","reason":"invalid UTF-8 JSON"}
Date Wed, 09 Dec 2009 12:56:05 GMT
what about:

curl -X POST http://localhost:5984/test/ -d "{\"title\":\"There is Nothing
Left to Lose\",\"artist\":\"Foo Fighters\"}"

(different way to escape)

On Wed, Dec 9, 2009 at 1:52 PM, Kamyar Navidan <kamyar.n@gmail.com> wrote:
>>
>>  So something like:
>
>
>
>
> % curl -X POST http://localhost:5984/test/ -d "{""title"":""There is Nothing
> Left to Lose"",""artist"":""Foo Fighters""}"
>
>
> Will work.
>
> No it doesn't. This is what I get:
>
> C:\Users\Kamyar> curl -X POST http://localhost:5984/zxc/ -d
> "{""title"":""There
> is Nothing Left to Lose"",""artist"":""Foo Fighters""}"
> {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> curl: (6) Could not resolve host: is; No data record of requested type
> curl: (6) Could not resolve host: Nothing; No data record of requested type
> curl: (6) Could not resolve host: Left; No data record of requested type
> curl: (6) Could not resolve host: to; No data record of requested type
> curl: (6) Could not resolve host: Lose,artist:Foo; No data record of
> requested t
> ype
>
> On Wed, Dec 9, 2009 at 7:19 AM, Mark Hammond <skippy.hammond@gmail.com>wrote:
>
>> On 9/12/2009 2:04 PM, Kamyar Navidan wrote:
>>
>>> I had the same problem with cmd.exe. Seemingly it cannot emit utf-8. I
>>> solved this problem by using Power Shell (win7).
>>>
>>
>> It appears there is only ascii in your example.  I think you are just
>> hitting the different quoting rules of cmd.exe - specifically, single quotes
>> are not special and double quotes must be "doubled" to be quoted.  So
>> something like:
>>
>>
>>
>> % curl -X POST http://localhost:5984/test/ -d "{""title"":""There is
>> Nothing Left to Lose"",""artist"":""Foo Fighters""}"
>>
>> Will work.
>>
>> HTH,
>>
>> Mark
>>
>



-- 

--
Andrew Melo
Andrew.Melo@gmail.com

Mime
View raw message