title: WIX Fetch API returns empty JSON (VELO)
body: <h2>Overview</h2>
  <p>I am using AgileCRM. I would like to create new contacts in this CRM when users complete a form. I have been successful in doing just that within PostMan. I am trying to do a simple &quot;GET&quot; request from WIX so I can understand VELO code before I get into my POST request (create contacts).</p>
  <h2>Problem</h2>
  <p>When I make <code>GET</code> request I get a status of <code>200</code>, I get an empty JSON as a response and in my request header is says my method is a <strong><code>POST</code></strong> which is not what I defined as the method.</p>
  <h2>Question</h2>
  <p>What is it that I am doing wrong here that is causing both an empty response and incorrect method?</p>
  <h2>Setup</h2>
  <p>My front-end imports a backend function which handles the basic auth and fetching. I did it this way as when I did this from the front-end I got a CORS issue.</p>
  <pre><code>//agileapi.jsw
  import {fetch} from 'wix-fetch';
  import base64 from &quot;nodejs-base64-encode&quot;;
  import {getSecret} from 'wix-secrets-backend';
  
  export async function getAPIKey() {
    return await getSecret(&quot;AGILERESTAPI&quot;);
  }
  
  export async function getUsername() {
    return await getSecret(&quot;AGILEUSERNAME&quot;);
  }
  
  let password = getAPIKey()
  let username = getUsername()
  
  let options = {
      &quot;method&quot;: &quot;GET&quot;,
      headers: {
          &quot;Authorization&quot;: 'Basic ' + base64.encode(username + &quot;:&quot; + password, 'base64'),
          &quot;Content-Type&quot;: &quot;application/json&quot;,
      }
  }
  let url = &quot;https://photodynamic.agilecrm.com/dev/api/contacts&quot;;
  export async function getContacts() {
     await fetch(url, options)
      .then( (response) =&gt; {
          if(response.ok) {
              return response.json()
          }
          else {
              return Promise.reject('Fetch did not succeed');
          }}
      )
      .then((json) =&gt; console.log(json))
      .catch((err) =&gt; console.log(err));
  }
  
  //wix debug page code
  import {getContacts} from 'backend/agileapi'
  
  $w.onReady(function (){
     $w(&quot;#getContacts&quot;).onClick( (event) =&gt; {
          getContacts()
      })
  });
  </code></pre>