@@ -58,7 +58,7 @@ public function __construct(string $host, int $port, ?ClientInterface $httpClien
58
58
59
59
public function tabs (ContextInterface $ ctx ): array
60
60
{
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 " , [
62
62
"timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
63
63
]);
64
64
@@ -73,7 +73,7 @@ public function tabs(ContextInterface $ctx): array
73
73
public function open (ContextInterface $ ctx , ?string $ url = null ): Tab
74
74
{
75
75
$ response = $ this ->httpClient ->request (
76
- "POST " ,
76
+ "PUT " ,
77
77
"http:// {$ this ->host }: {$ this ->port }/json/new " . ($ url !== null ? "? " . urlencode ($ url ) : "" ),
78
78
[
79
79
"timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
@@ -84,7 +84,7 @@ public function open(ContextInterface $ctx, ?string $url = null): Tab
84
84
85
85
public function version (ContextInterface $ ctx ): Version
86
86
{
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 " , [
88
88
"timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
89
89
]);
90
90
return Version::fromJson (json_decode ($ response ->getBody ()->getContents ()));
@@ -160,7 +160,7 @@ public function createSession(ContextInterface $ctx, string $url = "about:blank"
160
160
*/
161
161
public function activateTabById (ContextInterface $ ctx , string $ id ): void
162
162
{
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 }" , [
164
164
"timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
165
165
]);
166
166
}
@@ -170,7 +170,7 @@ public function activateTabById(ContextInterface $ctx, string $id): void
170
170
*/
171
171
public function closeTabById (ContextInterface $ ctx , string $ id ): void
172
172
{
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 }" , [
174
174
"timeout " => $ ctx ->getDeadline () !== null ? $ ctx ->deadlineFromNow () : 0 ,
175
175
]);
176
176
}
0 commit comments