mirror of
https://github.com/restoreddev/phpapprentice.git
synced 2025-08-06 14:56:58 +02:00
Continuing transition to hugo
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
+++
|
||||
title = "HTTP"
|
||||
description = "Understanding the format of the web"
|
||||
tags = ["web", "http"]
|
||||
slug = "http"
|
||||
previous = "exceptions.html"
|
||||
next = "web/http-post.html"
|
||||
+++
|
||||
HTTP stands for Hypertext Transfer Protocol. It is a standard for how requests and responses should be formatted for
|
||||
a server and a web browser. When you open a link in your web browser, you are sending a HTTP request to a server and it
|
||||
is responding with a HTTP response. The browser then takes the response, parses it and displays it to the user.
|
||||
|
@@ -1,3 +1,11 @@
|
||||
+++
|
||||
title = "HTTP Post"
|
||||
description = "Sending data to a server"
|
||||
tags = ["web", "http", "post"]
|
||||
slug = "http-post"
|
||||
previous = "web/http.html"
|
||||
next = "web/http-server.html"
|
||||
+++
|
||||
HTTP uses multiple different request types for indicating actions that should be performed on the server. The most common ones
|
||||
you will use are:
|
||||
- GET -> Retrieve a resource
|
||||
|
@@ -1,3 +1,10 @@
|
||||
+++
|
||||
title = "PHP HTTP Server"
|
||||
description = "Handling HTTP Requests in PHP"
|
||||
tags = ["php", "http", "server"]
|
||||
slug = "http-server"
|
||||
previous = "web/http-post.html"
|
||||
+++
|
||||
In PHP, you usually use a separate web server program that accepts HTTP requests and passes them to PHP to create a response. Common examples of separate web server programs are Apache and Nginx. However, PHP has a built in web server we can use during development.
|
||||
|
||||
To use the development web server, open a terminal and a new folder for holding your code. Create a file called `index.php` and put this PHP code in it:
|
||||
|
Reference in New Issue
Block a user