UltraCore Core - API icon

UltraCore Core - API -----

UltraCore API for Spigot Plugins.



WebServer special code
The package name has been changed from it.ultracore.* to shop.ultracore.*

- Removed the String index from the WebServer Class Builder.

A new "programming language" has been added to the WebServer, since PHP is not an option
This "programming language" as now comprehends this "methods":
getVersion(); - returns the version of the plugin
getFileName(); - returns the name of the file that the user is actually on
getRequestedFileName(); - returns the name of the requested file (the one on the navbar), this can be useful in the 404 page for example.
getAddress(); - gets replaced with the address of the user
getPort(); - gets replaced with the port of the user
die(); - stops the loading of the page to this line and gets replaced with null
die(String string); - stops the loading of the page to this line and gets replaced with the String string
api.call(String url, String method, boolean echo, String arguments); - Sends an HTTP Request (the method is the String method, and could be either "GET", or "POST" (ignoreCase)), the boolean echo is whether this should be replaced with the response, or with null (true = response, false = null). The arguments are the parameters and the values, and should be like this: "ID=1&name=test". NOTE: No questionmark (?) at the beginning.
plugin.execute(String action, boolean echo) - calls the method #execute(String action) in the WebServer class (to work, the class must Override "public String execute(String action)". echo: true = this is going to be replaced with the String returned by the method #execute(String action) in the WebServer class; false = this is going to be replaced with null.
The code must be inside of the tags "<uc>" and "</uc>". And the begin and end tags must be on different lines.
Code (HTML5):

<html>

<uc>
Version: getVersion();
</uc>

</html>
 
Also, the file name must end with ".uc" instead of ".html". The Strings also mustn't be inside of the quotes (""), example:
Code (HTML5):

api.call(http://example.com, POST, false, ID=1 &name=test);
 

+ Added the #sendRequest(String url, String method, String urlParameters) method, which can throw a IOException. The method is the HTTP method type, and can be "GET" or "POST". The urlParameters is the arguments, and should be like this: "ID=1&name=test". NOTE: No questionmark (?) at the beginning.

* Other minor changes.
----------, Apr 19, 2019
Resource Information
Author:
----------
Total Downloads: 1,918
First Release: Mar 18, 2019
Last Update: Feb 18, 2023
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings