Skip to content

Commit

Permalink
Support request protocol version (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Jul 11, 2023
1 parent f045635 commit 08defd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public function method(): string
return 'GET';
}

/**
* Get request HTTP protocol version.
*/
public function version(): string
{
return '1.1';
}

/**
* Get request query string parameters.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static function request(Request $request, ?string $baseUri = null): Reque
}
}

return $psrRequest->withBody(
return $psrRequest->withProtocolVersion($request->version())->withBody(
Psr17FactoryDiscovery::findStreamFactory()
->createStream((string) $request->body())
);
Expand Down

0 comments on commit 08defd4

Please sign in to comment.