X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/3c23b2cde4f8d6de57d5e1cc86828d6d200da65d..f2a5805cac945d9dbadc37ff1c7946e938a0d9f1:/src/shpub/Command/Like.php diff --git a/src/shpub/Command/Like.php b/src/shpub/Command/Like.php index 70e836f..7daafc2 100644 --- a/src/shpub/Command/Like.php +++ b/src/shpub/Command/Like.php @@ -27,18 +27,8 @@ class Command_Like ] ); - $req = new \HTTP_Request2($this->host->endpoints->micropub, 'POST'); - $req->setHeader('Content-type', 'application/x-www-form-urlencoded'); - $req->setHeader('Authorization', 'Bearer ' . $this->host->token); - $req->setBody($body); - $res = $req->send(); - if (intval($res->getStatus() / 100) != 2) { - Log::err( - 'Server returned an error status code ' . $res->getStatus() - ); - Log::err($res->getBody()); - exit(11); - } + $req = new Request($this->host); + $res = $req->send($body); $postUrl = $res->getHeader('Location'); echo "Like created at server\n"; echo $postUrl . "\n";