# POST to API

**URL:** <https://community.glideapps.com/t/post-to-api/38715>\
**Category:** Ask for Help\
**Created:** [February 19, 2022, 7:41pm UTC](https://community.glideapps.com/t/post-to-api/38715 "2022-02-19T19:41:26Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [August 6, 2022, 11:51pm UTC](https://community.glideapps.com/t/post-to-api/38715/8 "2022-08-06T23:51:44Z")

</div>

Hola @david

Just a couple of technical questions about JavaScript libraries that Glide uses in their plugins: Fetch JSON & JavaScript.

I know we cannot make POST requests by using the Fetch JSON column but our plan B can be a custom JS code and run it via JavaScript plugin. It’s is fine but sometimes I have problems to understand and find the correct syntax within all the JS libraries and flavors available around the world. 🙄

I read time ago that Glide uses _Lodash_ as JS library and also, we can import other [JS libraries](https://community.glideapps.com/t/how-to-import-code-packages-in-the-javascript-column/34466) but I have a doubt about the Fetch() function and the right/best syntax to use.

As you know, _Fetch() API_ supports the **Promise** object and helps a lot to retrieve/handle data and intercept any error during the execution of the request.  
For example, this simple code uses Promise objects:

```auto
fetch('https://yesno.wtf/api') 
  .then(response => response.text())
  .then(result => console.log(result)) 

```

and returns these values using text format (.text()):  
`

> {“answer”:“no”,“forced”:false,“image”:“[https://yesno.wtf/assets/no/1-c7d128c95c1740ec76e120146c870f0b.gif](https://yesno.wtf/assets/no/1-c7d128c95c1740ec76e120146c870f0b.gif)”}

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/9/99ead696c59f3268c0ccae632a362cd203c21bb3.png)

but the above code cannot be used in Glide, the JS plugin doesn’t support it and we must change it using this syntax:

```auto
var Response = await fetch('https://yesno.wtf/api')
const Result= await Response.text();
return Result

```

Glide shows the result like (all is ok)  
…  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/c/3c75b82dc5e952fb5c3408752bca56855e70d56e.png)

As you can imagine, if I try to run my Glide code in other JS editors, nothing works 🤨

So, my questions are:

1. Which JS library can I import into Glide in order to work/use Fetch API’s Promise objects?
2. If I want to use Bearer authorization in Glide’s JavaScript plugin, which JS library do I have to import/use?
3. If I want to test my Glide JS code on other online platforms like [JSFiddle](https://jsfiddle.net/), what language do I have to choose to get right results?. I tested it using “TypeScript” but no luck!

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/e/5e2ae0fa09e05f38fb0ebf78a0f718c3a53fb364.png)

Thanks David, saludos!

---

_[View the full topic](https://community.glideapps.com/t/post-to-api/38715)._
