Using APIs

Flexible RESTful Requests with MEM

When working with MEM, you are not restricted to using only molecule.sh for making RESTful requests. The 3EM environment offers the EXM.deterministicFetch() function, which allows you to make any desired request. This flexibility enables you to seamlessly integrate RESTful interactions into your MEM applications, expanding the range of possibilities for data retrieval and communication.

Example: GET request

const req = await EXM.deterministicFetch("http://rand.molecule.sh/generate/0/100")
const res = req.asJSON() // -> '{"result":63}'

Last updated

mem.tech ยฉ 2023