Linux CURL的安装和使用
来源:互联网 发布:php调用mssql存储过程 编辑:程序博客网 时间:2024/06/08 12:53
转载:http://www.52harry.com/program/linux/2011-11-11/518.html
--获得安装包,从网上直接下载或者其他途径,这里直接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代码,是百度首页的代码
入门的使用说明:
http://www.javaeye.com/topic/648143
-------------------------------------------------------------------------------------------
使用实例(发送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 CURL的安装和使用
- Linux CURL的安装和使用
- Linux CURL的安装和使用
- Linux CURL的安装和使用
- Linux CURL的安装和使用
- linux下curl的安装和使用
- 安装和使用curl
- Linux CURL的安装
- Linux CURL的安装
- Linux:curl的使用
- cURL安装和使用笔记
- 关于curl和json的安装和使用
- linux下curl的安装
- linux中CURL的安装
- linux中CURL的安装
- windows下curl的安装和简单使用
- windows下curl的安装和简单使用
- C++实现Creational - Factory Method模式
- Python访问Sql Server
- 出现频率最高的笔试题strcpy写法
- 项目周
- 配置Apache服务器支持向目录PUT文件
- Linux CURL的安装和使用
- oracle 之 权 限 问 题
- U-Boot Stage2
- python __mro__ c3算法
- 嵌入式应用中存储器类型的选择技巧
- 对数据库连接的一点感悟
- Unix网络编程基础学习笔记一(地址结构相关)
- sqlmap注入语句整理
- 使用Python模拟登录QQ邮箱获取QQ好友列表