I would advise to not make it more complicate as it is. openhab uses swagger, one of the best REST API documentation and testing tool which exists IMO.
to access it, you can open https://openhab:8443/doc/index.html
there you can read how to webservice works, what methods you need to send, and the commands. mostly for sending simple commands you send it as text/plain instead of json.
first you need to decide to a technology… javascript ajax request, with any server side scripting language or higher programing language making http post/get/… requests.
when you decided what you want to use, you will become help for sure