My Bukkit/Spigot HTTP REST API Wrapper Lib

Status
This thread has been locked.

Wvisoecj

Supreme
Feedback score
9
Posts
471
Reactions
677
Resources
0
Hello friends! At around 3am I was crying in my bed because sockets are annoying and take forever to implement. Then the idea to create a HTTP REST wrapper dawned upon me.

I did some research and I don't think anyone has made this before but I've successfully created an early alpha version of the library. It's extremely easy to implement and I've taken care of the HTTP engine support, and method visibility from the REST calls.

Here's the plugin implementation, there's some extra code in there for me so I can test but it's about 25-ish real lines of code for the API.
00222e025e.png

This is the response from the browser, the convention is super simple, http://ADDR:PORT/ClassName/MethodName. The lib provides means to change the path so you don't have to keep the classname as a path. By default the lib returns application/json in the headers but all this is customizable so you can write your own website on here but it's main goal is to simplify HTTP REST for bukkit.

55d199824b.png
d0f23858f1.png

Let me know what you think! Is it a stupid idea? Would you use it? Any suggestions? Thanks!
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Wvisoecj

Supreme
Feedback score
9
Posts
471
Reactions
677
Resources
0
Looks interesting! So this would allow a website to easily communicate with a plugin, like how Buycraft works?
Not sure how Buycraft works but you can turn a bukkit plugin into a rest api.
 
Status
This thread has been locked.
Top