zoukankan      html  css  js  c++  java
  • 用curl模拟夹带cookie的http请求

    1. 首先登录所要登录的网站,发起http请求,获取cookie

    2. 获取请求的真正的路径,现在的前端比如vue都是用自定义路径映射后端路径的,比如在vue中某个请求为caojiangjiang/test,那么它实际映射的路径可能为cjj/cjj/test,所以要获取真实的url,这一点可以问公司的op(运维),也可以通过手机访问网站,然后自己抓包获取真正的请求路径

    curl -b "bi_device_id=8d7e6a00-299d-417e-8dc6-96b777427c1f; acw_tc=76b20fe615452129218561722e7743ff9e08bc666f839d50de436ff69ba9ab; QXUEXI-AUTH-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwIjoicGMiLCJrIjoic2lnbmluVDE4MzU5MjY1MTkwcGFzc3BjNWMyZDlhNmI2ZDFlZiIsImMiOiJUIiwidWlkIjoiNjY0NzAifQ.MAxWRv1os9_wY1_CgeknBFB31XTplFlNVFF36V7RUFU; QXUEXI_SIGNER_ID=66470; QXUEXI-AUTH-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwIjoicGMiLCJrIjoic2lnbmluVDE4MzU5MjY1MTkwcGFzc3BjNWMyZDlhNmI2ZDFlZiIsImMiOiJUIiwidWlkIjoiNjY0NzAifQ.MAxWRv1os9_wY1_CgeknBFB31XTplFlNVFF36V7RUFU; QXUEXI_SIGNER_ID=66470; Hm_lvt_599aca18636a86abbf2f0e8706849e27=1546841299; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2216827999945297-09986a22cdda47-35607400-1024000-168279999467ad%22%7D; Hm_lpvt_599aca18636a86abbf2f0e8706849e27=1546852604"  -A "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.0)"  xxxxxxxxxx/merchant/classroom/into -X POST -d "usertype=1&roomid=12&jumpurl=xxxxxx&extraData=dfdfdd" 

    -b "" 添加cookie

    -X POST

    -d "a=xx&b=xx"

    -A "" 模拟浏览器请求

    url 直接写,不加引号或者双引号

  • 相关阅读:
    IOC和DI的区别
    hdu 1217(Floyed)
    hdu 2112(字典树+最短路)
    hdu 4081(次小生成树)
    hdu 1811(缩点+拓扑排序+并查集)
    poj 3026(BFS+最小生成树)
    hdu 3635(并查集)
    hdu 3047(扩展并查集)
    hdu 1116(并查集+欧拉路径)
    poj 1679(次小生成树)
  • 原文地址:https://www.cnblogs.com/cjjjj/p/10237057.html
Copyright © 2011-2022 走看看