Iteratively posting via cURL set of Json records in bash -


i have set of json records in file. post iteratively. example file "jsondata.dat" contains following json records

{        "json_records":[              {                "name": "name_1",                 "mark": "mark_1"              },               {                "name": "name_2",                 "mark": "mark_2"              }         ] } 

i post each json record i.e.

{    "name": "name_x",    "mark": "mark_x" } 

in separate curl post. how achieve in bash?

i use jq pipe each record single line, read output while loop pass curl.

jq -c '.json_records[]' | while ifs= read -r rec;   curl -x post -d"$rec" "$url" done 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -