Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 660 Bytes

File metadata and controls

20 lines (14 loc) · 660 Bytes

http.get

Performs a simple HTTP get request in behavior packs.

Since most requests are GET requests without bodies, @minecraft/server-net provides this convenience method. The only difference between this method and http.request() is that it sets the method to GET automatically.

Example:

import { http } from '@minecraft/server-net';

http.get('http://localhost:8000/').then((response) => {
  // Body content of the HTTP response.
  // Type: string
  const body = response.body;
});