Mojira Archive
BDS-18526

enum HttpRequestMethod don't work

The enum HttpRequestMethod don't work with the last version of @minecraft/server (1.5.0-BETA), with previous version (1.3.0) it's work, with the same package @minecraft/server-net;

 

Steps to Reproduce:
1. You just need to create ato write "const req = new mcnet.HttpRequest(uri);"
2.  And after set the method "req.method = mcnet.HttpRequestMethod.POST"
3. And after execute it on the server

Observed Results:
We received a error message for the line "req.method = mcnet.HttpRequestMethod.POST"

Expected Results:

No error message and set the method work without problems.

 

I found a solution for the last version of the API but it's needed to do it in JavaScript like that:
const keys = Object.keys(mcnet.HttpRequestMethod);
const index = Object.keys(mcnet.HttpRequestMethod).indexOf("Post");
const value = Object.values(mcnet.HttpRequestMethod)[indexOfApple];
 
 
Thanks for your attention. 
 

Environment

On linux server with code writted with typescript with gulp to compile

Comments3

Hi

Does this issue still occur after updating to 1.20.15?

This ticket will automatically reopen when you reply.

Hi,

I just try it and it's work now.

Thanks for the fix.

 

Best Regards,

Closing as per comment above.

History5

mrauks

Added labels: za

Removed labels:

mrauks

Added labels: Server scripting-api

Removed labels: za

Maciej Piornik
[Bot] Arisa
Maciej Piornik
Cannot Reproduce
mrauks
0
0
Unconfirmed
Server scripting-api
1.20.1 Hotfix