Skip to content

Commit 026d5e0

Browse files
committed
fix: patch up non-exisstent request::header()
1 parent ee20a94 commit 026d5e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/docs/http/request.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,26 +185,26 @@ $uploadInfo = request()->upload('profile_pic', './uploads', [
185185

186186
## Request Headers
187187

188-
Headers are a very important part of HTTP requests. They contain information about the request that can be used to make decisions in your application. You can use the `headers()` method to get a specific header from the request.
188+
Headers contain information about the request that can be used to make decisions in your application. You can use the `headers()` method to pull the header information from the request.
189189

190190
```php:no-line-numbers
191191
$allHeaders = request()->headers();
192192
```
193193

194-
You can also use the `header()` method to get a specific header from the request.
194+
You can also specify a specific header to get:
195195

196196
```php:no-line-numbers
197-
$contentType = request()->header('Content-Type');
197+
$contentType = request()->headers('Content-Type');
198198
```
199199

200-
One thing to note is that all headers are sanitized automatically by Leaf. If you want to disable this behavior, you can pass `false` as a parameter to the `headers()` or `header()` method.
200+
One thing to note is that all headers are sanitized automatically by Leaf. If you want to disable this behavior, you can pass `false` as a parameter to the `headers()` method.
201201

202202
```php
203203
$allHeaders = request()->headers(
204204
safeHeaders: false
205205
);
206206

207-
$contentType = request()->header(
207+
$contentType = request()->headers(
208208
'Content-Type',
209209
false
210210
);

0 commit comments

Comments
 (0)