In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the use cases of the curl command in linux, which is very detailed and has certain reference value. Friends who are interested must finish it!
Details of the use of the curl command in linux: 1, [curl url] gets the text information of the URL; 2, [curl-I url] gets the text information of the URL and protocol header information; 3, [curl-x proxy url] uses the agent to obtain the text information of the web page.
Details of using the curl command in linux:
1. Curl url (get the text information of the URL)
Curl www.zhujy.com
This is the www.zhujy.com information obtained.
Welcome to nginx! Body {width: 35eme; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif;} Welcome to nginx!
If you see this page, the nginx web server is successfully installed andworking. Further configuration is required.
For online documentation and support please refer tonginx.org.Commercial support is available atnginx.com.
Thank you for using nginx.
2. Curl-I url (get the text information and protocol header information of the URL)
This is the www.zhujy.com text information obtained as well as the protocol header information.
HTTP/1.1 200 OKServer: nginx/1.14.0Date: Mon, 11 Mar 2019 02:06:55 GMTContent-Type: text/htmlContent-Length: 612Last-Modified: Mon, 29 Oct 2018 09:52:22 GMTConnection: keep-aliveETag: "5bd6d856-264" Accept-Ranges: bytesWelcome to nginx! Body {width: 35eme; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif;} Welcome to nginx!
If you see this page, the nginx web server is successfully installed andworking. Further configuration is required.
For online documentation and support please refer tonginx.org.Commercial support is available atnginx.com.
Thank you for using nginx.
3. Curl-x proxy url (use agents to obtain web page text information)
Test Page for the Nginx HTTP Server on Fedora / * * / Welcome to nginx on Fedora!
This page is used to test the proper operation of the nginx HTTP server after it has been installed. If you can read this page, it means that the web server installed at this site is working properly.
Website Administrator
This is the default index.html page that is distributed with nginx on Fedora. It is located in / usr/share/nginx/html.
You should now put your content in a location of your choice and edit the root configuration directive in the nginx configuration file / etc/nginx/nginx.conf.
4. Curl-X POST-- header "Content-Type:application/json"-- data'{} 'url (use post to simulate json format request API)
Curl-X POST-- header "Content-Type:application/json"-- data'{} '127.0.0.1:8088/user/getAllUserInfo {"resultCode": "0", "resultMsg": "success", "data": {"userList": [{"id": "a6fc8f27-e598-11e8-ba67-00163e14685b", "name": "tom", "age": "18", "address": "Beijing 1", "stage": "NBA"} {"id": "24793d7c-e199-11e8-ba67-00163e14685b", "name": "tom", "age": "18", "address": "Beijing 3", "stage": "NBA"}, {"id": "247acf89-e599-11e8-ba67-00163e14685b", "name": "jerry", "age": "18", "address": "Shenzhen 22", "stage": "NBA"}, {"id": "247cdafc-e599-11e8-ba67-00163e14685b", "name": "james" "age": "38", "address": "Guangzhou d4", "stage": "NBA"}, {"id": "247ed96c-e599-11e8-ba67-00163e14685b", "name": "curry", "age": "58", "address": "Shanghai fv", "stage": "NBA", {"id": "24805b4e-e599-11e8-ba67-00163e14685b", "name": "kaven", "age": "78", "address": "Longxian", "stage": "NBA"} {"id": "2481f851-e599-11e8-ba67-00163e14685b", "name": "durant", "age": "68", "address": "Fuping", "stage": "NBA"}
POST specifies the request method
-header specifies the request header information
-data specifies the body data content of the json request
5. Curl-I url (only request header information is returned)
Curl-I www.zhujy.com.cnHTTP/1.1 200 OKServer: nginx/1.14.0Date: Mon, 11 Mar 2019 03:34:29 GMTContent-Type: text/htmlContent-Length: 612Last-Modified: Mon, 29 Oct 2018 09:52:22 GMTConnection: keep-aliveETag: "5bd6d856-2018" Accept-Ranges: bytes is all the content of the use case of the curl command in linux, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.