Skip to content

Commit f758920

Browse files
authored
Merge pull request #7120 from kenjis/fix-docs-http.rst
docs: update http.rst
2 parents f0bf8bd + b780c0d commit f758920

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

user_guide_src/source/concepts/http.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################
2-
Working With HTTP Requests
2+
Working with HTTP Requests
33
##########################
44

55
In order to get the most out of CodeIgniter, you need to have a basic understanding of how HTTP requests

user_guide_src/source/concepts/http/001.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
use CodeIgniter\HTTP\IncomingRequest;
44

5-
$request = service('request');
5+
$request = request();
66

7-
// the URI being requested (i.e., /about)
7+
// the URI path being requested (i.e., /about)
88
$request->getUri()->getPath();
99

1010
// Retrieve $_GET and $_POST variables
@@ -22,7 +22,9 @@
2222
$request->getServer('Host');
2323

2424
// Retrieve an HTTP Request header, with case-insensitive names
25-
$request->getHeader('host');
26-
$request->getHeader('Content-Type');
25+
$request->header('host');
26+
$request->header('Content-Type');
2727

28-
$request->getMethod(); // get, post, put, etc
28+
// Checks the HTTP method
29+
$request->is('get');
30+
$request->is('post');

user_guide_src/source/concepts/http/002.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use CodeIgniter\HTTP\Response;
44

5-
$response = service('response');
5+
$response = response();
66

77
$response->setStatusCode(Response::HTTP_OK);
88
$response->setBody($output);

0 commit comments

Comments
 (0)