How-to articles, tricks, and solutions about HTTP
Adding header for HttpURLConnection
To add a header to an HTTP request using HttpURLConnection, you can use the setRequestProperty method.
Detecting request type in PHP (GET, POST, PUT or DELETE)
In PHP, you can use the $_SERVER['REQUEST_METHOD'] superglobal to detect the request type.
Doing HTTP requests FROM Laravel to an external API
To make an HTTP request from Laravel to an external API, you can use the HTTP client of your choice.
How can I select and upload multiple files with HTML and PHP, using HTTP POST?
You can use the following HTML code to create a form that allows users to select and upload multiple files.
How do I do a HTTP GET in Java?
To send an HTTP GET request in Java, you can use the java.net.URL and java.net.HttpURLConnection classes.
How do I implement basic "Long Polling"?
Here's an example of how you can implement Long Polling in PHP:
How Does the Access-Control-Allow-Origin Header Work
Read this tutorial and learn about how the Access-Control-Allow-Origin response header works. Also, read about CORS, the origin, and non-simple requests.
How to disable output buffering in PHP
In PHP, you can disable output buffering by calling the ob_end_flush() function or flush() function.