RE: PeakeCoin Games - JavaScript Balance Showing Error

You are viewing a single comment's thread:

without testing it and just at a first glance before coffee: my guess is you are missing the headers for the POST e.g.

        const r = await fetch(url, {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' }, // <- this part
            body: JSON.stringify(payload)
        });


0
0
0.000
4 comments
avatar

@thecrazygm I tried playing with it some and I get a 415 error. I'm sure it's a key thing as per usual, JavaScript isn't as easy to read as python is... The struggles.

I'm currently studying for my master electrical license also, but I will be back to hash this out

0
0
0.000
avatar
(Edited)

Unusual error for what I think you are attempting to do. If you haven't looked into it yet:

415 Unsupported Media Type

The request entity has a media type which the server or resource does not support. For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.

EDIT: So, depending on where it's giving the error, it could still be the type application/json line.

0
0
0.000
avatar

I fixed this. Now working on the render function.

0
0
0.000