Intro: Making requests

API requests serve as the means of communication between your Minecraft server and your microservice.

Note: Make sure you have initialized your API host before making calls to your microservice. Check Initialization of the API before continuing.

Quick: What are API requests?

Utilizing API requests enables communication between your Minecraft server and your microservices. This proves to be a valuable tool in the development of plugins, as it grants the plugin access to external data that can be incorporated into the gaming experience.

Which request method would be best to use?

A thorough understanding of the appropriate request methods and their corresponding status codes is crucial when working with microservices.

The four most commonly utilized request methods in microservices are GET, POST, PUT and DELETE. Here are some recommended scenarios for their use in your plugin:

MethodExample purpose

GET

Retrieve player data such as name, statistics, inventory, etc.

POST

Allow players to submit content, such as creating a clan or an in-game object.

PUT

Update player data such as adding coins or updating their inventory.

DELETE

Remove player data, such as deleting a friend or when their account is deleted.

Proceed to the next section to gain knowledge on how to establish communication between your Minecraft server and your microservice.

Last updated