PhalconRest\Api\ApiEndpoint::post PHP Method

post() public static method

Returns pre-configured POST endpoint
public static post ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
return ApiEndpoint
    public static function post($path, $handlerMethod = null)
    {
        return self::factory($path, HttpMethods::POST, $handlerMethod);
    }

Usage Example

 public function initialize()
 {
     $this->name('User')->model(User::class)->expectsJsonData()->transformer(UserTransformer::class)->handler(UserController::class)->itemKey('user')->collectionKey('users')->deny(AclRoles::UNAUTHORIZED, AclRoles::USER)->endpoint(ApiEndpoint::all()->allow(AclRoles::USER)->description('Returns all registered users'))->endpoint(ApiEndpoint::get('/me', 'me')->allow(AclRoles::USER)->description('Returns the currently logged in user'))->endpoint(ApiEndpoint::post('/authenticate', 'authenticate')->allow(AclRoles::UNAUTHORIZED)->deny(AclRoles::AUTHORIZED)->description('Authenticates user credentials provided in the authorization header and returns an access token')->exampleResponse(['token' => 'co126bbm40wqp41i3bo7pj1gfsvt9lp6', 'expires' => 1451139067]));
 }