title: AXIOS: Can I send more than one Data item to an API in a POST request?
body: <p>So I have a form that collects data, and gets sent to an API using myForm = new FormData(). One of the items being populated in the model, however, has multiple attributes in the MongoDB model. Since the form has to have 1-to-1 key-pair relationships, I can't send it over as an object. So, as a solution, I build the object in my controller, and I'd like to send it over with other misc. form data (startLocation object in the code below).</p>
  <p>Looking specifically at the code below, I was thinking I would be able to do it using <strong>data: myForm, startLocation</strong>, but, sadly, this does not work. Is there a good way to do this? Am I just screwing up the syntax?</p>
  <pre><code>import axios from 'axios';
  import { showAlert } from './alerts';
  
  export const createTour = async myForm =&gt; {
    try {
      const startLocation = {
        type: 'Point',
        coordinates: [-80.185942, 25.774772],
        address: '47 Bowman Lane, Kings Park, NY 11754',
        description: 'New York'
      };
  
      const res = await axios({
        method: 'POST',
        /* headers: {
          'Content-Type': `multipart/form-data; boundary=${myForm._boundary}`
        }, */
        url: 'http://127.0.0.1:8000/api/v1/tours',
        data: myForm
      });
  
      if (res.data.status === 'success') {
        showAlert('success', 'NEW TOUR CREATED!');
        window.setTimeout(() =&gt; {
          location.assign('/');
        }, 1500);
      }
    } catch (err) {
      showAlert('error', err.response.data.message);
    }
  };
  </code></pre>