mirror of
https://codeberg.org/reflect/reflect-client-php.git
synced 2025-09-13 17:43:42 +02:00
feat: add support for OPTIONS requests
This commit is contained in:
parent
1ed38a8c3d
commit
e4d4d88e03
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,6 @@
|
||||||
if ($this->key) {
|
if ($this->key) {
|
||||||
$this->headers["Authorization"] = "Bearer {$this->key}";
|
$this->headers["Authorization"] = "Bearer {$this->key}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct HTTP headers string from array
|
// Construct HTTP headers string from array
|
||||||
$headers = array_map(fn(string $k, string $v): string => "{$k}: {$v}\r\n", array_keys($this->headers), array_values($this->headers));
|
$headers = array_map(fn(string $k, string $v): string => "{$k}: {$v}\r\n", array_keys($this->headers), array_values($this->headers));
|
||||||
|
@ -137,4 +136,8 @@
|
||||||
$this->set_request_body($payload);
|
$this->set_request_body($payload);
|
||||||
return new Response(...$this->http_call(Method::DELETE));
|
return new Response(...$this->http_call(Method::DELETE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function options(): Response {
|
||||||
|
return new Response(...$this->http_call(Method::OPTIONS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue