http服务-建立一个简单http客户端

http服务-建立一个简单http客户端

使用的开源库是libcurl,它支持很多协议,在这只使用http协议,来实现对http服务器上传文本及图片。
  • libcurl简介
    from wikipedia
    libcurl is a free client-side URL transfer library, supporting FTP, FTPS, Gopher, HTTP, HTTPS, SCP, SFTP, TFTP, Telnet, DICT, the file URI scheme, LDAP, LDAPS, IMAP, POP3, SMTP and RTSP. The library supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, Kerberos, HTTP form-based upload, proxies, cookies, user-plus-password authentication, file transfer resume, and HTTP proxy tunneling.
    The libcurl library is portable. It builds and works identically on many platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HP-UX, IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Symbian, AmigaOS, OS/2, BeOS, OS X, iOS, Android, Ultrix, QNX Neutrino, BlackBerry Tablet OS and BlackBerry 10,[5] OpenVMS, RISC OS, NetWare and DOS.
    The libcurl library is free, thread-safe and IPv6 compatible. Bindings are available for more than 40 languages, including C/C++, Java, PHP and Python.
    The libcurl library can support SSL/TLS through OpenSSL, GnuTLS, NSS, wolfSSL, mbed TLS, axTLS, QSOSSL on IBM i, Secure Transport on OS X and iOS, and SChannel on Windows.
    from 百度百科
    libcurl主要功能就是用不同的协议连接和沟通不同的服务器~也就是相当封装了的sockPHP 支持libcurl(允许你用不同的协议连接和沟通不同的服务器)。, libcurl当前支持http, https, ftp, gopher, telnet, dict, file, 和ldap 协议。libcurl同样支持HTTPS证书授权,HTTP POST, HTTP PUT, FTP 上传(当然你也可以使用PHP的ftp扩展), HTTP基本表单上传,代理,cookies,和用户认证。

  • libcurl编译、配置
    参考这篇文章

#未完待续

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值