Post http request to my wix site.

@raphaelhuotmtl Yes, Is the database ID correct? Check for permissions. Else try this:

import {created, serverError} from 'wix-http-functions';
import wixData from 'wix-data';

let auth = {
"suppressAuth": true,
"suppressHooks": true
};

export function post_addUserLeaderboard(request) {
let options = {
"headers": {
"Content-Type": "application/json"
}
};
return request.body.json()
.then( (body) => {
return database(body, options);
})
.catch( (error) => {
options.body = {
"error": error
};
return serverError(options);
});
}

function database(body, options) {
let leaderboardEntry = {
"title": body.title,
"score": body.score
};
return wixData.insert("fastLifeLeaderboard", leaderboardEntry, auth)
.then( (result) => {
let item = result;
options.body = {
"status": 200,
"item": item
};
return created(options);
});
}