title: react axios post generates json in array format. How to convert this to "name":"value" type format
body: <p><a href="https://i.stack.imgur.com/wmnRJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wmnRJ.png" alt="enter image description here"></a></p>
  
  <pre><code>        const submitService = {
          serviceType: this.state.serviceType,
          dateOfService: this.state.dateOfService,
          vehicleId: this.state.vehicleId,            
          orderNum: this.state.orderNum,
          driverId: this.state.driverId,
          vendorName: this.state.vendorName,
          issueId: this.state.issueId
      };
  
      axios.post("http://localhost:8072/TruckyServiceMicroService/admin/services/saveService/", submitService)
          .then(response =&gt; {
              if (response.data != null) {
                  this.setState(this.initialState);
                  alert("Service Created Successfully");
              }
  
          });
  </code></pre>
  
  <p>This is the const forming the json and the post request sent using the const. On sending the post request through axios, it adds square braces in the json</p>
  
  <pre><code>    initialState = {
      serviceType: [], vehicleId: '', dateOfService: '', orderNum: '', driverId: '', vendorName: '', issueId: ''
  }
  </code></pre>
  
  <p>This is the state</p>