[BDS-18526] enum HttpRequestMethod don't work Created: 11/Jul/23  Updated: 29/Sep/23  Resolved: 29/Sep/23

Status: Resolved
Project: Bedrock Dedicated Server
Affects Version/s: 1.20.1 Hotfix
Fix Version/s: None

Type: Bug
Reporter: mrauks Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: Server, scripting-api
Environment:

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


Confirmation Status: Unconfirmed

 Description   

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. 
 



 Comments   
Comment by Maciej Piornik [ 29/Sep/23 ]

Closing as per comment above.

Comment by mrauks [ 19/Sep/23 ]

Hi,

I just try it and it's work now.

Thanks for the fix.

 

Best Regards,

Comment by Maciej Piornik [ 15/Sep/23 ]

Hi

Does this issue still occur after updating to 1.20.15?

This ticket will automatically reopen when you reply.

Generated at Sat Jan 11 08:22:09 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.