title: cURL post json data, json array and image files REST api testing
body: <p>I'm facing a problem with complex http request via cURL. 
  I'm building REST API with NODEjs, using Express routers and Multer middleware to handle multiple body data and files.</p>
  
  <p>My endpoint route  127.0.0.1/api/postData
  expects:
   json data with fields, one of which is array of json objects (I'm having nested mongoose schema) and 2 named images (png/jpg). </p>
  
  <p>I need to send Post request via cURL with the following 5-object data structure:</p>
  
  <pre><code>name  String
  description String
  usersArray  Array of json objects like:   [{"id": "123"}, {"id": "456}]
  imgIcon  Png/Image    providing  /path/to/imageIcon.png
  imgHeader Png/Image     providing /path/to/imageHeader.png
  </code></pre>
  
  <p>I've read a lot of threads on stackoverflow, but all of them are answers to a particular singular problem, one thread about curl post images, another cURL post arrays,  but not altogether. </p>
  
  <p>I've tried REST API test tools like POSTMAN and DHC (google chrome), and there everything's fine except for arraysArray field
  I used the fields like:<br>
   usersArray[0]   {"id": "123"}
   usersArray[1]   {"id": "456"}<br>
  But validation didn't pass, cuz  the json object value is parsed somehow incorrectly. </p>
  
  <p>So I decided to put everything in cURL script. </p>
  
  <p>I tried to write my cURL request in following way:</p>
  
  <pre><code>   #!/bin/bash
     curl -H 'Content-Type: application/json'
    -H 'Accept: application/json'  -X POST 
  -F "name=Foo Name Test" 
  --data '[{"id": "a667cc8f-42cf-438a-b9d8-7515438a9ac1"}, {"id": "7c7960fb-eeb9-4cbf-9838-bcb6bc9a3878"}]' 
  -F "description=Super Bar" 
  -F "imgIcon=@/home/username/Pictures/imgIcon.png" 
  -F "imgHeader=@/home/username/Pictures/imgHeader.png" http://127.0.0.1:7777/api/postData
  </code></pre>
  
  <p>When I run my cUrl script in bash
  ./postData</p>
  
  <p>I got this:
  $ Warning: You can only select one HTTP request!</p>
  
  <p>You can help with:</p>
  
  <p>1) Any Idea how to write such a complex HTTP REST request in cURL</p>
  
  <p>2) Or with suggestion of tools (like DHC, POSTMAN) to solve this complex http request. </p>
  
  <p>3) or with any idea how to write this request with the help of request.js  node http request library. </p>
  
  <p>Thank you all in advance for all answers, thoughts and ideas!!</p>
  
  <p>Regards, JJ</p>