title: How to send Array of Objects in retrofit Android?
body: <p>I have an below array of objects to be passed in the service call.</p>
  
  <pre><code>    [
    {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.5385fc250cf2497dfe5679d1"
      }
  }, 
    {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.5385ff2f0cf2497dfe567c0c"
      }
  }, 
    {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.5385fd700cf2e65ecf6330c6"
      }
  }, {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.5385fefe0cf2497dfe567bee"
      }
  }, {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.5385ff690cf2497dfe567c3f"
      }
  }, {
      "ParkingSpace": {
          "sid": "WorldSensing.vhu6lom3sovk6ahpogebfewk5kqadvs4.55e972d21170d0c2fd7d15b1"
      }
  }]
  </code></pre>
  
  <p>I am trying like below:</p>
  
  <pre><code>private String generateParkingspaceBody(final List&lt;String&gt; listOfsIds) {
  
          //sids array
          JSONArray sidsArray = new JSONArray();
  
          for (String sId: listOfsIds) {
  
              //creating sidObject and object
              JSONObject sIdObject = new JSONObject();
              JSONObject object = new JSONObject();
  
  
              try {
                  sIdObject.put("sid", sId);
                  object.put("ParkingSpace",sIdObject);
                  sidsArray.put(object);
              } catch (JSONException e) {
                  CPALog.e(TAG,e.getMessage());
              }
  
  
  
          }
          return sidsArray.toString();
      }
  </code></pre>
  
  <p>Sending this string into the service call like:</p>
  
  <pre><code> Response getNearByParkingSpaces(@Header("Authorization") String accessToken,
                                      @Header("Content-Type") String contentType,
                                      @Body String arrayOfSids);
  </code></pre>
  
  <p>But in request showing in the logact is :</p>
  
  <pre><code>"[{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}},{\"ParkingSpace\":{}}]"
  </code></pre>
  
  <p>Please help me, how to send this request?</p>
  
  <p>Thanks in advance.</p>