title: The requested route [/add_action] has not been mapped in Spark for Accept: [*/*]
body: <p>I get this no matter what I do. It does not happen on the GET right above it. </p>
  
  <p>Java Spark:</p>
  
  <pre><code>package controllers;
  
  import static spark.Spark.*;
  
  import action.EmailReader;
  import data.ActionReply;
  import db.ActionsTable;
  import spark.Request;
  import spark.Response;
  import spark.Route;
  import utilities.JsonUtil;
  import utilities.Tools;
  
  public class ActionController {
  
      public ActionController() {
          get("/active_actions", (req, res) -&gt; getActiveActions(res, req.queryParams("username")), JsonUtil.json());
          put("/add_action/", (req, res) -&gt; putActiveActions(res, req.queryParams("username"), req.queryParams("data")), JsonUtil.json());
      }
  
      public ActionReply getActiveActions(Response resp, String username) {
          //Access-Control-Allow-Origin: http://siteA.com
          resp.header("Access-Control-Allow-Origin", "*");
          return new ActionReply("Success", true, "blahblahblah");
      }
  
      public ActionReply putActiveActions(Response resp, String username, String data) {
          //Access-Control-Allow-Origin: http://siteA.com
          resp.header("Access-Control-Allow-Origin", "*");
          ActionsTable.addFlowToEngine(username, data);
          return new ActionReply("Success", true, "Successful PUT.");
      }
  
  }
  </code></pre>
  
  <p>AJAX Request:</p>
  
  <pre><code>var edata = editor().getValue();
          self.actions.push(edata);
          $.ajax({
                 type: "PUT",
                 dataType: "json",
                 username: "dan_the_man",
                 data: edata,
                 url: "http://localhost:4567/add_action",
                 success: function(data){
                   console.log(data);
                 }
              });
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>507936 [qtp1182316047-39] INFO spark.http.matching.MatcherFilter - The requested route [/add_action/] has not been mapped in Spark for Accept: [*/*]
  </code></pre>
  
  <p>I also get:
  Access to XMLHttpRequest at '<a href="http://dan_the_man@localhost:4567/add_action/" rel="nofollow noreferrer">http://dan_the_man@localhost:4567/add_action/</a>' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  
  <p>Which I don't know why its doing this since I am setting the header to accept anything. </p>