Linuxのcurlコマンドの詳しい説明
Linux でのcurl コマンドの使用詳細: 1. [curl url] URL のテキスト情報を取得します; 2. [curl -i url] は URL のテキスト情報とプロトコル ヘッダー情報を取得します; 3. . [curl -x proxy url]プロキシを利用してWebページのテキスト情報を取得します。
Linux でのcurlコマンドの使用の詳細:
1.curl url (URLを取得します) URL) テキスト情報)
curl www.zhujy.com
これは、取得した www.zhujy.com 情報です
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
2、 curl -i url (URLのテキスト情報とプロトコルヘッダ情報を取得)
www.zhujy.comのテキスト情報とプロトコルヘッダ情報を取得します。
HTTP/1.1 200 OK Server: nginx/1.14.0 Date: Mon, 11 Mar 2019 02:06:55 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Mon, 29 Oct 2018 09:52:22 GMT Connection: keep-alive ETag: "5bd6d856-264" Accept-Ranges: bytes <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
3.curl -x プロキシ URL (プロキシを使用して Web ページのテキスト情報を取得します)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Test Page for the Nginx HTTP Server on Fedora</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> /*<![CDATA[*/ body { background-color: #fff; color: #000; font-size: 0.9em; font-family: sans-serif,helvetica; margin: 0; padding: 0; } :link { color: #c00; } :visited { color: #c00; } a:hover { color: #f50; } h1 { text-align: center; margin: 0; padding: 0.6em 2em 0.4em; background-color: #294172; color: #fff; font-weight: normal; font-size: 1.75em; border-bottom: 2px solid #000; } h1 strong { font-weight: bold; font-size: 1.5em; } h2 { text-align: center; background-color: #3C6EB4; font-size: 1.1em; font-weight: bold; color: #fff; margin: 0; padding: 0.5em; border-bottom: 2px solid #294172; } hr { display: none; } .content { padding: 1em 5em; } .alert { border: 2px solid #000; } img { border: 2px solid #fff; padding: 2px; margin: 2px; } a:hover img { border: 2px solid #294172; } .logos { margin: 1em; text-align: center; } /*]]>*/ </style> </head> <body> <h1>Welcome to <strong>nginx</strong> on Fedora!</h1> <div> <p>This page is used to test the proper operation of the <strong>nginx</strong> 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.</p> <div> <h2>Website Administrator</h2> <div> <p>This is the default <tt>index.html</tt> page that is distributed with <strong>nginx</strong> on Fedora. It is located in <tt>/usr/share/nginx/html</tt>.</p> <p>You should now put your content in a location of your choice and edit the <tt>root</tt> configuration directive in the <strong>nginx</strong> configuration file <tt>/etc/nginx/nginx.conf</tt>.</p> </div> </div> <div> <a href="http://nginx.net/"><img src="nginx-logo.png" alt="[ Powered by nginx ]" width="121" height="32" /></a> <a href="http://fedoraproject.org/"><img src="poweredby.png" alt="[ Powered by Fedora ]" width="88" height="31" /></a> </div> </div> </body> </html>
4.curl -X POST - -header "Content-Type:application/json" --data '{}' url (JSON 形式のリクエスト インターフェイスをシミュレートするには post を使用します)
curl -X POST --header "Content-Type:application/json" --data '{}' 127.0.0.1:8088/user/getAllUserInfo
{"resultCode":"0","resultMsg":"成功","data":{"userList":[{"id":"a6fc8f27-e598-11e8-ba67-00163e14685b","name":"tom","age":"18","address":"北京1","stage":"NBA"},{"id":"24793d7c-e199-11e8-ba67-00163e14685b","name":"tom","age":"18","address":"北京3","stage":"NBA"},{"id":"247acf89-e599-11e8-ba67-00163e14685b","name":"jerry","age":"18","address":"深圳22","stage":"NBA"},{"id":"247cdafc-e599-11e8-ba67-00163e14685b","name":"james","age":"38","address":"广州d4","stage":"NBA"},{"id":"247ed96c-e599-11e8-ba67-00163e14685b","name":"curry","age":"58","address":"上海fv","stage":"NBA"},{"id":"24805b4e-e599-11e8-ba67-00163e14685b","name":"kaven","age":"78","address":"陇县","stage":"NBA"},{"id":"2481f851-e599-11e8-ba67-00163e14685b","name":"durant","age":"68","address":"富平","stage":"NBA"}]}}
POST はリクエスト メソッドを指定します
– header はリクエスト ヘッダー情報を指定します
–data は json リクエスト本文のデータ コンテンツを指定します
5.curl -I url (リクエスト ヘッダー情報のみを返します)
curl -I www.zhujy.com.cn
HTTP/1.1 200 OK Server: nginx/1.14.0 Date: Mon, 11 Mar 2019 03:34:29 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Mon, 29 Oct 2018 09:52:22 GMT Connection: keep-alive ETag: "5bd6d856-264" Accept-Ranges: bytes
関連学習の推奨事項: Linux ビデオ チュートリアル
以上がLinuxのcurlコマンドの詳しい説明の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック









この記事では、パターンマッチング、ファイル検索、テキスト操作、グレップ、SED、awkなどのツールの詳細、ファイル検索、テキスト操作のためにLinuxで正規表現(Regex)を使用する方法について説明します。

この記事では、Linuxシステムのパフォーマンスを監視するためにTop、HTOP、およびVMSTATを使用して、効果的なシステム管理のための独自の機能とカスタマイズオプションを詳述することについて説明します。

この記事では、Google Authenticatorを使用してLinux上のSSH用の2要素認証(2FA)のセットアップ、インストール、構成、およびトラブルシューティング手順の詳細に関するガイドを提供します。 Enhanced Secなど、2FAのセキュリティ利益を強調しています

記事では、APT、Yum、およびDNFを使用してLinuxでソフトウェアパッケージの管理を行い、インストール、更新、および削除をカバーしています。さまざまな分布に対する機能と適合性を比較します。

この記事では、LinuxのSudo特権を管理する方法について説明します。重要な焦点は、 /etc /sudoersの安全性とアクセスを制限することです。

Linuxの初心者は、ファイル管理、ユーザー管理、ネットワーク構成などの基本操作をマスターする必要があります。 1)文件管理:使用mkdir、タッチ、ls rm 3)ネットワーク構成:ifconfig、echo、およびufwコマンドを使用します。これらの操作はLinuxシステム管理の基礎であり、それらをマスターすることでシステムを効果的に管理できます。

Linuxシステムの5つの柱は次のとおりです。1。Kernel、2。SystemLibrary、3。Shell、4。FileSystem、5。SystemTools。カーネルはハードウェアリソースを管理し、基本的なサービスを提供します。システムライブラリは、アプリケーション用の事前コンパイルされた機能を提供します。シェルは、ユーザーがシステムと対話するインターフェイスです。ファイルシステムはデータを整理して保存します。また、システムツールはシステム管理とメンテナンスに使用されます。

Linux Systemsでは、起動時に特定のキーを押すか、「sudosystemctlrescue」などのコマンドを使用することにより、メンテナンスモードを入力できます。メンテナンスモードを使用すると、管理者は、ファイルシステムの修復、パスワードのリセット、セキュリティの脆弱性など、干渉なしにシステムメンテナンスとトラブルシューティングを実行できます。
