curl-loader, syntax for JSON directory
Status: Alpha
Brought to you by:
coroberti
From: Henrik A. S. <BU...@tm...> - 2013-08-06 11:43:42
|
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 |