Slimframework send json to another application url

Asked

Viewed 41 times

1

I’m developing a system integration, and I’m using Slim Framework I’m using an Action called Cron <- was created by min.

Cron has a method called checkComplited

private function verificarComplited($id, $status = 0){

    try
    {
        $complited = $this->db->prepare("select * from completed where id = :id");
        $complited->bindParam("id", $id);
        $complited->execute();
        if ($complited->rowCount() > 0) {
            return true;
        }else{
            $moduloCompleted = $complited->fetchAll(\PDO::FETCH_OBJ);
            $json = json_encode($moduloCompleted);
            $app->post('http://localhost:8888/', function ($json) use ($app){

            });

        }
    }
    catch (PDOException $e)
    {
        echo "erro ao adicionar usuario tabela mdl_user_enrolments";
        return "erro ao adicionar usuario tabela mdl_user_enrolments";

    }


}

I need to submit $json to a url outside of my project as I can do this ?

  • $app->post is what?

  • it’s not working, would you give me a tip ?

  • the context for solution is greater so you need to put in your whole question, to try to help! only with this excerpt becomes complicated.

  • Okay, I’ll try to make it clear.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.