File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " jerome/fetch-php" ,
33 "description" : " The JavaScript fetch API for PHP." ,
4- "version" : " 2.0.3 " ,
4+ "version" : " 2.0.4 " ,
55 "type" : " library" ,
66 "license" : " MIT" ,
77 "authors" : [
2727 "php" : " ^8.0" ,
2828 "guzzlehttp/guzzle" : " ^7.9" ,
2929 "guzzlehttp/psr7" : " ^2.7" ,
30- "psr/http-message " : " ^1.0| ^2.0" ,
31- "jerome/matrix " : " ^2.0"
30+ "jerome/matrix " : " ^2.0" ,
31+ "psr/http-message " : " ^1.0| ^2.0"
3232 },
3333 "require-dev" : {
3434 "friendsofphp/php-cs-fixer" : " ^3.64" ,
35+ "laravel/pint" : " ^1.21" ,
3536 "mockery/mockery" : " ^1.6" ,
3637 "pestphp/pest" : " ^2.0|^3.0" ,
3738 "phpstan/phpstan" : " ^1.11.5" ,
Original file line number Diff line number Diff line change @@ -286,6 +286,16 @@ public function withHeaders(array $headers): self
286286 return $ this ;
287287 }
288288
289+ /**
290+ * Set a single header for the request.
291+ */
292+ public function withHeader (string $ header , mixed $ value ): self
293+ {
294+ $ this ->options ['headers ' ][$ header ] = $ value ;
295+
296+ return $ this ;
297+ }
298+
289299 /**
290300 * Set the body for the request.
291301 */
Original file line number Diff line number Diff line change @@ -14,11 +14,26 @@ interface ClientHandler
1414 */
1515 public static function handle (string $ method , string $ uri , array $ options = []): mixed ;
1616
17+ /**
18+ * Set the token for the request.
19+ */
20+ public function withToken (string $ token ): self ;
21+
22+ /**
23+ * Set the basic auth for the request.
24+ */
25+ public function withAuth (string $ username , string $ password ): self ;
26+
1727 /**
1828 * Set the headers for the request.
1929 */
2030 public function withHeaders (array $ headers ): self ;
2131
32+ /**
33+ * Set a single header for the request.
34+ */
35+ public function withHeader (string $ header , mixed $ value ): self ;
36+
2237 /**
2338 * Set the body for the request.
2439 */
You can’t perform that action at this time.
0 commit comments