title: Axios get function sends empty request
body: <p>im doing a simple MERN blog-project, trying to learn new things. I've already made server, and now working with client side. I've tested endpoints with Postman, and they're working correctly. The problem is on the client side with axios.</p>
  <pre><code>const sensorResponse = await axios({
          method: 'get',
          url: url,
          headers: {&quot;X-Auth-Token&quot;: localStorage.getItem('auth-token'),
          &quot;content-type&quot;: &quot;application/json&quot; },
          data : {
              userId: user.id
          }
      })
  </code></pre>
  <p>and the get end point</p>
  <pre><code>router.get('/', auth, async (req,res)=&gt;{
   const {userId} = req.body;
   console.log(req.body);
   console.log(userId);
   const blogs = await Blog.find({userId:userId})
   res.json(blogs)
   })
  </code></pre>
  <p>authorization is correct, console.log in the &quot;auth&quot; function displays and verifies the token correctly. unfortunately get endpoint displays req.body as empty object in console. I've tried another request function:</p>
  <pre><code>const blogResponse = await axios.get(url,data,headers)
  </code></pre>
  <p>but it works the same...
  could you guys suggest me how should this request look like?</p>
  <p>///// EDIT SOLVED PROBLEM</p>
  <pre><code>const sensorResponse = await axios({
          method: 'get',
          url: url,
          headers: {&quot;x-auth-token&quot;: localStorage.getItem('auth-token'),
          &quot;content-type&quot;: &quot;application/json&quot; },
          params: {
              'userId': user.id
          }
      })
  </code></pre>
  <p>and to get the userId passed with params in request, endpoint should look like:</p>
  <pre><code>router.get('/', auth, async (req,res)=&gt;{
    const userId = req.query.userId;
     console.log(userId)
     const blogs= await Blog.find({userId:userId})
    res.json(blogs)
  </code></pre>
  <p>})</p>