#Error when fetching api

1 messages · Page 1 of 1 (latest)

finite void
#
export default {

    myFun2: async () => {
        //use async-await or promises
        const res = await fetch('url', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({'defaultOptionValue':  "dasdsa" }) 
  });
        
        
        const data = await res.json()

        return data;
        
    }
}

Return:
``
11:00:34
The value at template.txt_Restore.text is invalid
List.widget


where url = REST POST Endpoint
hollow lodgeBOT
#

Hey There,

We've registered your query, and our team will get back to you soon.

Regards,
Team Appsmith

#

Hey! I'm not sure that we currently support fetch(). Could you instead try this
with our REST integration?

finite void
#

what do you mean?

#

I saw in January 23' video that you are (or maybe it's not supported YET...)

#

The thing is that I need to do more in this function not just the fetch