Package server
Class SendMessageHandler
java.lang.Object
server.SendMessageHandler
- All Implemented Interfaces:
HttpHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(HttpExchange httpexchange) Http handler for sending messages to a chat Example: curl --header "Content-type: application/json" \ --request POST \ --data '{"chat": "Hennings Privata chat", "message": {"text": "Hämligt meddelande :)", "user": {"name": "Coola Henning", "id": "1"}, "time": "2026-02-04T11:14:05Z"}}' \ http://localhost:2345/send_message
-
Constructor Details
-
SendMessageHandler
-
-
Method Details
-
handle
Http handler for sending messages to a chat Example: curl --header "Content-type: application/json" \ --request POST \ --data '{"chat": "Hennings Privata chat", "message": {"text": "Hämligt meddelande :)", "user": {"name": "Coola Henning", "id": "1"}, "time": "2026-02-04T11:14:05Z"}}' \ http://localhost:2345/send_message- Specified by:
handlein interfaceHttpHandler- Throws:
IOException
-