3 namespace app\Github\API\Releases
;
5 use app\Github\API\Call
;
6 use app\Github\Exception\RequestException
;
7 use http\Client\Request
;
8 use http\Client\Response
;
11 class CreateReleaseAsset
extends Call
14 $body = new Body(fopen($this->args
["asset"], "rb"));
15 $request = new Request("POST", $this->args
["url"], [
16 "Authorization" => "token ". $this->api
->getToken(),
17 "Accept" => $this->config
->api
->accept
,
18 "Content-Type" => $this->args
["type"],
23 function response(Response
$response) {
24 if ($response->getResponseCode() >= 400 ||
null === ($json = json_decode($response->getBody()))) {
25 throw new RequestException($response);