1. First describe the HTTP common methods
Get gets the specified resource
POST submits data to the specified resource for processing requests
Head gets the specified resource header information
PUT replaces the specified resource (browser operation not supported)
Delete Deletes the specified resource
OPTIONS allows clients to view server performance
TRACE echo the request received by the server, primarily for testing or diagnostics
Connect is reserved for proxy servers that can change connections to pipelines (HTTP proxy usage)
Attention:
1. Due to security considerations, most servers do not open all HTTP request methods
2. Put and delete are currently not used much in the country, mostly by post, but put is the simplest way to implement file uploads in iOS development
2. Start the Http-dav feature (WebDAV server)
2.1 Opening the terminal
Cd/etc/apache2sudo Vim httpd.conf
Find in 2.2 vim
/httpd-dav.conf
Delete # comment, save exit
2.3 Modifying Httpd-dav extension files
Open Terminal
Cd/etc/apache2/extrasudo vimhttpd-dav.conf
Change the position in the digest to Basic, save exit
Attention:
1. The first red line location is modified by the way the user authorizes
2. The second red location is the file that holds the user's password (/USER/USER.PASSWD)
3. The third red location is the user name (Admin) that can use the put request
3. Modify the User.password file
3.1 Setting a password
Cd/usrsudo HTPASSWD–C/USR/USER.PASSWD Admin
Set a new password
3.2 Modifying user groups
sudo chgrp www/usr/usr.passwd
4. Upload folder settings
4.1 Creating a var folder
sudo mkdir-p/usr/varsudo chown-r Www:www/usr/var
4.2 Create an Upload folder: Uploads
sudo mkdir-p/usr/uploadssudo chown-r www:www/usr/uploads
4.3 Restarting Apache
sudo apachectl-k restart
LS-L Displays the file information below the USR folder
5. Test the WebDAV server
The first step
Step Two
Step Three
Fourth Step
Open a WebDAV server in a Mac environment