Re: curl-loader, syntax for JSON directory
Status: Alpha
Brought to you by:
coroberti
From: Robert I. <cor...@gm...> - 2013-08-06 11:49:40
|
Hi Henrik, Not all functionality of curl is matched. What you wish to be done, requires some patching. It's open-source, and, believe me, very friendly C-written code. Dig into it and expand for your purpose. Kind regards, Robert On Tue, Aug 6, 2013 at 2:24 PM, Henrik Aagaard Sørensen <BU...@tm...> wrote: > I’ve posted a question on Stack Overflow: > > http://stackoverflow.com/questions/18074252/curl-loader-syntax-for-json-directory > > > > However, I thought I might as well post it here on the official mailinglist. > > > > I'm trying to load test an API with curl-loader. I'm able to call the API > via standard curl like this: > > curl -X POST http://localhost/api -H "Authorization: MY-ID" -d '{"resource": > "ba424b79-5b38-4a34-85d7-c194f72cb145", "records": [{"a": 1, "b": "xyzxyz"}, > {"a": 2, "b": "zzzzzz"}], "key": "a"}' > > This works, however, when trying to create a conf-file for curl-loader, I'm > not able to create the JSON-part correctly. > > I've tried with the following: > > HEADER="Authorization: MY-ID" > > MULTIPART_FORM_DATA='{"resource": "ba424b79-5b38-4a34-85d7-c194f72cb145", > "records": [{"a": 1, "b": "xyzxyz"}, {"a": 2, "b": "zzzzzz"}], "primary": > "a"}' > > It fails with: > > multipart_form_data_parser - error: no '=' sign in multipart_form_data. > > But when I try to split it up like this: > > HEADER="Authorization: MY-ID" > > MULTIPART_FORM_DATA='resource="ba424b79-5b38-4a34-85d7-c194f72cb145"' > > MULTIPART_FORM_DATA='records=[{"a": 1, "b": "xyzxyz"}, {"a": 2, "b": > "zzzzzz"}]' > > MULTIPART_FORM_DATA='primary="a"' > > it does run, but my values are not updated as if I just run curl itself. The > log just says: > > # 1375774696564 Tue Aug 6 09:38:16 2013 > > # msec_offset cycle_no url_no client_no (ip) indic info > > 0 0 0 1 !! CONT 100 > > 0 0 0 3 !! CONT 100 > > 0 0 0 2 !! CONT 100 > > 45 0 0 3 !! ERCL 400 HTTP/1.1 400 Bad Request > > 89 0 0 1 !! ERCL 400 HTTP/1.1 400 Bad Request > > 90 0 0 2 !! ERCL 400 HTTP/1.1 400 Bad Request > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > curl-loader-devel mailing list > cur...@li... > https://lists.sourceforge.net/lists/listinfo/curl-loader-devel > -- Regards, Robert Iakobashvili, Ph.D. Home: http://www.ghotit.com .............................................. Ghotit Dyslexia Das Ist Real Writer & Reader ............................................... |