技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> Linux --> curl 命令使用cookie

curl 命令使用cookie

浏览:8670次  出处信息

    curl -c cookie.txt www.baidu.com

    cat cookie.txt

    # Netscape HTTP Cookie File

    # http://www.netscape.com/newsref/std/cookie_spec.html

    # This file was generated by libcurl! Edit at your own risk.

    .baidu.com      TRUE    /       FALSE   4294967295      BAIDUID F12E0E84A1A44C56325C9FB70263B8B7:FG=1

    [root@bsso software-rpm]# curl -b cookie.txt baidu.com -v

    * About to connect() to baidu.com port 80

    *   Trying 220.181.6.182... * connected

    * Connected to baidu.com (220.181.6.182) port 80

    > GET / HTTP/1.1

    User-Agent: curl/7.12.1 (i686-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6

    Host: baidu.com

    Pragma: no-cache

    Accept: */*

    Cookie: BAIDUID=F12E0E84A1A44C56325C9FB70263B8B7:FG=1

    ...

    这里旨在提醒一下cookie文件的格式,以前一直以为是name=value形式的;今天使用时,才发现:

以下是引用片段:
Curl has the ability to read and write cookie files that use the same file     format that Netscape and Mozilla do

建议继续学习:

  1. cookie窃取和session劫持    (阅读:12685)
  2. Rolling cURL: PHP并发最佳实践    (阅读:10106)
  3. curl检查访问网页返回的状态码    (阅读:6499)
  4. 前端开发中Cookie那些事儿    (阅读:6018)
  5. 如何设置一个永远无法删除的Cookie    (阅读:5038)
  6. 在浏览器中加密Cookie    (阅读:4342)
  7. PHP用CURL伪造IP和来源    (阅读:4190)
  8. curl测试下载速度    (阅读:4130)
  9. 网站统计:第一方Cookie和第三方Cookie    (阅读:4039)
  10. cURL基础教程    (阅读:3844)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
<< 前一篇:ssldump
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1