Adds a new route with given path to the current context
that accepts POST requests.

@param string $path
The route path
@param callable $handler
The route handler

@return self
964575
public function post(string $path, $handler)
  {
    return $this->request($path, Request::HTTP_POST, $handler);
  }
640138
public function delete(string $path, $handler)
  {
    return $this->request($path, Request::HTTP_DELETE, $handler);
  }
1142598
public function get(string $path, $handler)
  {
    return $this->request($path, Request::HTTP_GET | Request::HTTP_HEAD, $handler);
  }
787338
public function group(string $prefix, callable $handler) : RouterInterface {
        $this->setPrefix($prefix);
        $handler($this);
        $this->setPrefix('');
        return $this;
    }
1245613
public Blade after(@NonNull String path, @NonNull RouteHandler handler) {
        this.routeMatcher.addRoute(path, handler, HttpMethod.AFTER);
        return this;
    }
909010
public function get($path, $handler, $info = null)
    {
        $this->addRoute(["GET"], null, $path, $handler, $info);
    }
8736
public function createRoute(?string $method, string $path, $handlers): Route
    {
        if ($handlers instanceof \Peak\Blueprint\Http\Stack) {
            return new Route($method, $path, $handlers);
        }
        if (!is_array($handlers)) {
            $handlers = [$handlers];
        }
        return new Route($method, $path, new Stack($handlers, $this->getHandlerResolver()));
    }
532344
public function put(string $path, $handler)
  {
    return $this->request($path, Request::HTTP_PUT, $handler);
  }
328200
public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {
        return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)
    }
750191
function Route(ctx, path, handler) {
  if (!(this instanceof Route))
    return new Route(ctx, path, handler);

  this.ctx = null;
  this.path = null;
  this.handler = null;

  this.regex = /^/;
  this.map = [];
  this.compiled = false;

  if (ctx) {
    assert(typeof ctx === 'object');
    this.ctx = ctx;
  }

  if (path) {
    if (path instanceof RegExp) {
      this.regex = path;
    } else {
      assert(typeof path === 'string');
      assert(path.length > 0);
      this.path = path;
    }
  }

  assert(handler);
  assert(typeof handler === 'function' || typeof handler === 'object');

  this.handler = handler;
}
16779
public function add($path, $middleware = null)
    {
        if (!isset($middleware)) {
            $middleware = $path;
            $path = null;
        }

        if (!empty($path) && !ctype_digit($path) && $path[0] !== '/') {
            trigger_error("Middleware path '$path' doesn't start with a '/'", E_USER_NOTICE);
        }
        
        if (!is_callable($middleware)) {
            throw new \InvalidArgumentException("Middleware should be callable");
        }

        if (!empty($path)) {
            $middleware = $this->wrapMiddleware($path, $middleware);
        }
        
        $this->middlewares[] = $middleware;
        
        return $this;
    }
671848
public static function patch($path, $handlerMethod = null)
    {
        return self::factory($path, HttpMethods::PATCH, $handlerMethod);
    }
764331
@Deprecated
    public Blade post(@NonNull String path, @NonNull RouteHandler0 handler) {
        this.routeMatcher.addRoute(path, handler, HttpMethod.POST);
        return this;
    }
1063420
public function post($path, $handler, $info = null)
    {
        $this->addRoute(["POST"], null, $path, $handler, $info);
    }
458040
public function map($optionsOrMethod, $path, $handler)
    {
        $this->options = $this->defaultOptions($optionsOrMethod);
        $this->path = $path;
        $this->handler = $handler;
        return $this;
    }
18309
@Deprecated
    public Blade put(@NonNull String path, @NonNull RouteHandler0 handler) {
        this.routeMatcher.addRoute(path, handler, HttpMethod.PUT);
        return this;
    }
1369356
public Javalin post(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.POST, path, handler);
    }