@@ -58,7 +58,7 @@ public function __construct(string $host, int $port, ?ClientInterface $httpClien
5858
5959 public function tabs (ContextInterface $ ctx ): array
6060 {
61- $ response = $ this ->httpClient ->request ("POST " , "http:// {$ this ->host }: {$ this ->port }/json/list " , [
61+ $ response = $ this ->httpClient ->request ("GET " , "http:// {$ this ->host }: {$ this ->port }/json/list " , [
6262 "timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
6363 ]);
6464
@@ -73,7 +73,7 @@ public function tabs(ContextInterface $ctx): array
7373 public function open (ContextInterface $ ctx , ?string $ url = null ): Tab
7474 {
7575 $ response = $ this ->httpClient ->request (
76- "POST " ,
76+ "PUT " ,
7777 "http:// {$ this ->host }: {$ this ->port }/json/new " . ($ url !== null ? "? " . urlencode ($ url ) : "" ),
7878 [
7979 "timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
@@ -84,7 +84,7 @@ public function open(ContextInterface $ctx, ?string $url = null): Tab
8484
8585 public function version (ContextInterface $ ctx ): Version
8686 {
87- $ response = $ this ->httpClient ->request ("POST " , "http:// {$ this ->host }: {$ this ->port }/json/version " , [
87+ $ response = $ this ->httpClient ->request ("GET " , "http:// {$ this ->host }: {$ this ->port }/json/version " , [
8888 "timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
8989 ]);
9090 return Version::fromJson (json_decode ($ response ->getBody ()->getContents ()));
@@ -160,7 +160,7 @@ public function createSession(ContextInterface $ctx, string $url = "about:blank"
160160 */
161161 public function activateTabById (ContextInterface $ ctx , string $ id ): void
162162 {
163- $ this ->httpClient ->request ("POST " , "http:// {$ this ->host }: {$ this ->port }/json/activate/ {$ id }" , [
163+ $ this ->httpClient ->request ("GET " , "http:// {$ this ->host }: {$ this ->port }/json/activate/ {$ id }" , [
164164 "timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
165165 ]);
166166 }
@@ -170,7 +170,7 @@ public function activateTabById(ContextInterface $ctx, string $id): void
170170 */
171171 public function closeTabById (ContextInterface $ ctx , string $ id ): void
172172 {
173- $ this ->httpClient ->request ("POST " , "http:// {$ this ->host }: {$ this ->port }/json/close/ {$ id }" , [
173+ $ this ->httpClient ->request ("GET " , "http:// {$ this ->host }: {$ this ->port }/json/close/ {$ id }" , [
174174 "timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
175175 ]);
176176 }
0 commit comments