#post to lambda function through api and get data back

2 messages · Page 1 of 1 (latest)

mossy crypt
#

can I post to a lambda function and get data back ??
const restOp = post({
apiName: 'shipporatesapi',
path: '/shipporates',
options: {
body
}
})
const res = await restOp.response
console.log(res)
but what is returned is a buch of nonsence readableStream with a bunch of nothing in it.

mossy crypt
#

took me long enought but i figured it out finally... const restOp = post({
apiName: 'shippoApi',
path: '/shipporates',
options: {
body: input
}
})
const {body} = await restOp.response
const res = await body.json()
return res