<address id="ousso"></address>
<form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
  1. 操作系統

    安裝和使用Linux CURL的方法

    時間:2025-02-07 01:36:04 操作系統 我要投稿
    • 相關推薦

    安裝和使用Linux CURL的方法

      導語:Linux CURL應該如何安裝呢?下面就由小編為大家介紹一下安裝和使用Linux CURL的方法,大家一起去看看吧!

      --獲得安裝包,從網上直接下載或者其他途徑,這里直接wget

      # wget http://curl.haxx.se/download/curl-7.17.1.tar.gz

      --解壓到當前目錄

      # tar -zxf curl-7.17.1.tar.gz

      --進入解壓后的目錄內

      # cd curl-7.17.1

      --配置,指定安裝的目錄,這里是“/usr/local/curl”

      # ./configure --prefix=/usr/local/curl

      --

      # make

      --安裝

      # make install

      --安裝完畢

      使用:

      將curl命令加入環境變量,

      命令行里執行(僅對本會話起作用,或者在.bash_profile、.bashrc文件里配置環境變量):

      # export PATH=$PATH:/usr/local/curl/bin

      然后就可以使用了

      # curl http://www.baidu.com

      出來好多html代碼,是百度首頁的代碼

      -------------------------------------------------------------------------------------------

      使用實例(發送POST請求):

      # curl -d @json http://www.google.com/loc/json

      -d —— 是以POST形式發送請求

      @json —— @是從文件中讀取數據,json文件中的內容為{"address_language":"zh_CN","cell_towers":[{"cell_id":"36526","location_area_code":"14556","mobile_contry_code":"460","mobile_network_code":"02"}],"host":"maps.google.com","location":null,"request_address":true,"version":"1.1.0","wifi_towers":[]}

      返回:

      {"location":{"latitude":32.117302,"longitude":114.116598,"address":{"country":"中國","country_code":"CN","region":"河南省","city":"信陽市"},"accuracy":1625.0},"access_token":"2:FaXK0Xl_DHRbcQiK:5tGTJsZx1scpjUfJ"}

    【安裝和使用Linux CURL的方法】相關文章:

    Linux安裝和使用Glances的方法介紹10-28

    Linux的基礎命令和使用方法08-18

    PHP中使用cURL實現Get和Post請求的方法10-30

    關于linux使用方法09-20

    Linux網絡的安裝與配置方法10-25

    Linux的free命令使用方法09-10

    Linux中安裝Realplay 10.0 方法05-16

    在Linux系統下安裝QQ的方法07-22

    u盤簡單安裝linux的方法08-03

    <address id="ousso"></address>
    <form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
    1. 日日做夜狠狠爱欧美黑人