推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
yibinhp
V2EX  ›  Python

Python 脚本实现模拟 客户请求 API,求框架推荐

  •  
  •   yibinhp · May 8, 2021 · 2718 views
    This topic created in 1982 days ago, the information mentioned may be changed or developed.

    自己是搞 java 的,在做类似开放平台的,有一个需求,想模拟 7 、8 个客户接入我们的平台,每个客户每隔 N 秒(随机一个数)随机调用一个接口,有什么框架推荐的嘛,想以脚本的形式跑,由于对 python 只是刚刚了解语法的程度,求各位老哥推荐

    8 replies  •  2021-05-08 18:07:37 +08:00
    huifer
        1
    huifer  
       May 8, 2021
    request
    hushao
        2
    hushao  
       May 8, 2021 via iPhone   ❤️ 1
    同步 requests
    异步 httpx
    这俩用法基本一致,不同在于一个同步一个异步
    yibinhp
        3
    yibinhp  
    OP
       May 8, 2021
    @huifer @hushao OK,我去看看
    raptor
        4
    raptor  
       May 8, 2021
    写个 shell 脚本用 httpie 跑不就好了
    evil0harry
        5
    evil0harry  
       May 8, 2021
    用 postman 导出个可执行脚本,然后写个 bash 来随机?
    jiezhi
        6
    jiezhi  
       May 8, 2021
    省事点的话,先用浏览器请求下,然后复制 curl 出来,在线找个工具直接转成 py 的 requests 请求就好了。

    当然类似 paw 工具的话也可以将请求转成各种语言请求格式的。
    chogath
        7
    chogath  
       May 8, 2021
    为啥不用压测工具呢...
    ch2
        8
    ch2  
       May 8, 2021
    grequests
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   940 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 22:15 · PVG 06:15 · LAX 15:15 · JFK 18:15
    ♥ Do have faith in what you're doing.