]
);
- $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";