import httpserver.RequestSender;
import httpserver.WebServer;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class Controller {
    private WebServer ws = new WebServer();
    public TextField command;
    @FXML
    public TextArea results;

    public void runCommand(ActionEvent actionEvent) {
        results.setText("");
        ws.setResults(results);
        Thread th = new Thread() {
            @Override
            public void run() {
                String commandString = command.getText();
                RequestSender.sendRequest("http://localhost:8000/job", "13", commandString, "http://localhost:8008/jobFinished");
            }
        };
        th.start();
    }

}

@@ -1,24 +1,83 @@
+import converters.JsonConverter;%0Aimport datamodel.Request;%0A
 import httpserver.Reques
@@ -648,24 +648,25 @@
 .getText();%0A
+%0A
             
@@ -669,16 +669,330 @@
         
+Request request = new Request();%0A                request.setClientId(%2213%22);%0A                request.setCommand(commandString);%0A                request.setResponseAddress(%22http://localhost:8008/jobFinished%22);%0A%0A                String requestJsonString = JsonConverter.objectToJsonString(request);%0A%0A                //
 RequestS
@@ -1093,24 +1093,105 @@
 Finished%22);%0A
+                RequestSender.sendRequest(%22http://localhost:8000/job%22, request);%0A
             

Use new sendRequest method.