Is it possible to call an external http api (do an http post) from within a Realm function. If so any example code would be much appreciated
Yes, of course it’s possible: you can configure a 3rd Party Service, and call its endpoints with POST method, some sample code is here
1 Like
@Paolo_Manna Thanks, I have set all that up but now I keep getting a 401 unauthorized. I am using the following call
const auth = await http.post({
url: "https://xxxxxxxxxxxxxxxxxx.xxxxxxxxx.com",
Authorization: "Basic " + BSON.Binary.fromText(user).toBase64(),
encodeBodyAsJSON: true
})
where user is a string containing : eg fred:password
Any pointers as to what i might be doing wrong would be greatly appreciated.