Skip to content

Commit e3c589e

Browse files
committed
Adding isJson() and wantsJson() to Request
Needs to be documented.
1 parent 7c5df2c commit e3c589e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

requests.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,23 @@ The `Request` class provides many methods for examining the HTTP request for you
168168

169169
$value = Request::server('PATH_INFO');
170170

171+
#### Determining If The Request Is Over HTTPS
172+
173+
if (Request::secure())
174+
{
175+
//
176+
}
177+
171178
#### Determine If The Request Is Using AJAX
172179

173180
if (Request::ajax())
174181
{
175182
//
176183
}
177184

178-
#### Determining If The Request Is Over HTTPS
185+
#### Detect any type of JSON request
179186

180-
if (Request::secure())
187+
if (Request::ajax() or Request::isJson() or Request::wantsJson())
181188
{
182189
//
183190
}
@@ -189,4 +196,4 @@ The `Request::format` method will return the requested response format based on
189196
if (Request::format() == 'json')
190197
{
191198
//
192-
}
199+
}

0 commit comments

Comments
 (0)