public function created($location = null)
    {
        $this->respondWith(201);

        if (!empty($location)) {
            $this->setResponseHeader('Location', $location);
        }
    }
public function created($location = null)
    {
        $this->respondWith(201);

        if (!empty($location)) {
            $this->setResponseHeader('Location', $location);
        }
    }
public function created ( $ location = null ) { $ this -> respondWith ( 201 ) ; if ( ! empty ( $ location ) ) { $ this -> setResponseHeader ( 'Location' , $ location ) ; } }
Response with created 201 code, and optionally the created location

@param string $location  Url of created resource
Response with created 201 code and optionally the created location