Axios, Storefront API, Parameter missing or invalid

I’ve spent hours on this, someone please help. Trying to retrieve metafields from the Shopify storefront API with axios. Metafields are exposed. The post request works in Postman just fine. See image below.

I have literally copied Postman’s axios code verbatim and, and it returns a 404 error every time. I have tried lots of different things but to no avail. Can someone please tell me what I’m doing wrong? Here is my code:

var data = JSON.stringify({
        query: `query {     
        products(first:10) {         
          edges {             
            node {                 
              id                 
              handle                 
              metafields(first:10){                     
                edges {                         
                  node {                             
                    key                             
                    value                         
                  }                     
                }                 
              }             
            }         
          }     
        }
      }`,
        variables: {}
      });

      var config = {
        method: 'post',
        url: 'https://

Here is the error:

![Screen Shot 2021-09-05 at 12.28.50 PM.png|1420x520](upload://8TOqR2bBNVZexIhFfaS8miauvug.png)

Hi jackgeorge11,

Is it necessary to encode the data?

May you can just do this:

var config = {
  method: "post",
  url: "https://

Let me know how that goes.
1 Like

This is my issue haha. You think this code would work splendidly, but it returns a 400 status error…

I figured it out and for whatever reason, this code works properly:

await axios.post(
        'https://